Skip to content

Commit

Permalink
remove unrequired files
Browse files Browse the repository at this point in the history
  • Loading branch information
MahmoudRedaSayed committed Aug 22, 2023
1 parent 092e42b commit ac5569c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
1 change: 0 additions & 1 deletion pages/login.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from selenium import webdriver
from selenium.webdriver.common.by import By

class login:

Check failure on line 3 in pages/login.py

View workflow job for this annotation

GitHub Actions / Flake8

pages/login.py#L3

Expected 2 blank lines, found 1 (E302)
Expand Down
11 changes: 0 additions & 11 deletions tests/contest.py
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
import time
import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
@pytest.fixture
def driver():
driver = webdriver.Chrome()
driver.get("https://cshr.gent01.dev.grid.tf")
return driver

46 changes: 25 additions & 21 deletions tests/test_login.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
from pages.login import login
from tests.contest import driver
import utils
import time

def test_user_login(driver):
from pages.login import login
import pytest
from selenium import webdriver
@pytest.fixture

Check failure on line 5 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L5

Expected 2 blank lines, found 0 (E302)
def driver1():
driver = webdriver.Chrome()
driver.get("https://cshr.gent01.dev.grid.tf")
yield driver
driver.quit()
def test_user_login(driver1):

Check failure on line 11 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L11

Expected 2 blank lines, found 0 (E302)
login_instance = login()
# Enter email
email_input = driver.find_element(*login_instance.email)
email_input = driver1.find_element(*login_instance.email)
email_input.send_keys("[email protected]")
# Enter password
password_input = driver.find_element(*login_instance.password)
password_input = driver1.find_element(*login_instance.password)
password_input.send_keys("123456789")
# Click on Login button

Check failure on line 19 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L19

Indentation is not a multiple of 4 (comment) (E114)

Check failure on line 19 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L19

Unexpected indentation (comment) (E116)
login_button = driver.find_element(*login_instance.login_button)
login_button = driver1.find_element(*login_instance.login_button)
login_button.click()

time.sleep(20)
time.sleep(10)
# Get the profile
profile = driver.find_element(*login_instance.profile)
profile = driver1.find_element(*login_instance.profile)
# Assert that the element includes the text "AW"
assert "aw" in profile.text.lower()
def test_invalid_login(driver):
def test_invalid_login(driver1):

Check failure on line 28 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L28

Expected 2 blank lines, found 0 (E302)
login_instance = login()
# Enter email invalid email
email_input = driver.find_element(*login_instance.email)
email_input = driver1.find_element(*login_instance.email)
email_input.send_keys("[email protected]")

Check failure on line 33 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L33

Blank line contains whitespace (W293)
# Enter invalid password
password_input = driver.find_element(*login_instance.password)
password_input = driver1.find_element(*login_instance.password)
password_input.send_keys("123456789")

Check failure on line 37 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L37

Blank line contains whitespace (W293)
# Click on Login button
login_button = driver.find_element(*login_instance.login_button)
try:
login_button.click()
except Exception as e:
assert "element not clickable"
def test_email_validation(driver):
login_button = driver1.find_element(*login_instance.login_button)
try:login_button.click()

Check failure on line 40 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L40

Multiple statements on one line (colon) (E701)

Check failure on line 40 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L40

Missing whitespace after ':' (E231)
except ImportError:
assert True

Check failure on line 42 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L42

Trailing whitespace (W291)
def test_email_validation(driver1):

Check failure on line 43 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L43

Expected 2 blank lines, found 0 (E302)
login_instance = login()
# Enter email invalid email
email_input = driver.find_element(*login_instance.email)
email_input = driver1.find_element(*login_instance.email)
email_input.send_keys("[email protected]")
# get the error message
undefined_message=driver.find_element(*login_instance.undefined_message)
undefined_message=driver1.find_element(*login_instance.undefined_message)

Check failure on line 49 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L49

Missing whitespace around operator (E225)
actual_text = undefined_message.text
expected_text = "undefined"
assert actual_text == expected_text

Check failure on line 52 in tests/test_login.py

View workflow job for this annotation

GitHub Actions / Flake8

tests/test_login.py#L52

No newline at end of file (W292)

0 comments on commit ac5569c

Please sign in to comment.