one more cummit
This commit is contained in:
parent
2d22268020
commit
a5e2fc49a1
@ -1,11 +1,8 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
import time
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
import time
|
from my_constants import EMAIL, PASSWORD
|
||||||
|
|
||||||
|
|
||||||
EMAIL = 'jediforce82@gmail.com'
|
|
||||||
PASSWORD = 'aboba123'
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.order(1)
|
@pytest.mark.order(1)
|
||||||
@ -58,5 +55,4 @@ def open_profile(login):
|
|||||||
By.XPATH, "//*[@id='root']/div/div[1]/div[1]/div[1]/button[1]/img")
|
By.XPATH, "//*[@id='root']/div/div[1]/div[1]/div[1]/button[1]/img")
|
||||||
profile_icon_window.click()
|
profile_icon_window.click()
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
yield login
|
yield login
|
||||||
|
2
my_constants.py
Normal file
2
my_constants.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
EMAIL = 'jediforce82@gmail.com'
|
||||||
|
PASSWORD = 'aboba123'
|
@ -1,5 +1,6 @@
|
|||||||
from common_fixtures import driver, login, open_profile
|
from common_fixtures import driver, login, open_profile
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
|
from my_constants import EMAIL, PASSWORD
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
@ -20,6 +21,21 @@ def switcher(driver, ind):
|
|||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def get_password_fields():
|
||||||
|
return [driver.find_element(By.NAME, 'old_password'),
|
||||||
|
driver.find_element(By.NAME, 'password'),
|
||||||
|
driver.find_element(By.NAME, 'repeat_password')]
|
||||||
|
|
||||||
|
|
||||||
|
def old_new_password(driver):
|
||||||
|
old_password, password, repeat_password = get_password_fields()
|
||||||
|
old_password.send_keys(PASSWORD)
|
||||||
|
password.send_keys(2 * PASSWORD + 'а')
|
||||||
|
repeat_password.send_keys(2 * PASSWORD + 'а')
|
||||||
|
assert not driver.find_element(By.XPATH, "//*[@id='root']/div/div[1]/div[2]/div/div[2]/div[2]/div/form/div[3]/div[2]/div[2]").is_displayed()
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
def test_navigation(open_profile):
|
def test_navigation(open_profile):
|
||||||
login = open_profile
|
login = open_profile
|
||||||
profile_icon_window = login.find_element(
|
profile_icon_window = login.find_element(
|
||||||
@ -45,14 +61,25 @@ def test_profile_changes(open_profile):
|
|||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
driver.find_element(By.XPATH, "/html/body/div[2]/nav/a[2]").click()
|
driver.find_element(By.XPATH, "/html/body/div[2]/nav/a[2]").click()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
name_field = driver.find_element(By.NAME, "first_name")
|
fields = []
|
||||||
surname_field = driver.find_element(By.NAME, "last_name")
|
fields.append(driver.find_element(By.NAME, "first_name"))
|
||||||
father_name = driver.find_element(By.NAME, "middle_name")
|
fields.append(driver.find_element(By.NAME, "last_name"))
|
||||||
name_field.clear()
|
fields.append(driver.find_element(By.NAME, "middle_name"))
|
||||||
surname_field.clear()
|
fields.append(driver.find_element(By.NAME, 'birthdate'))
|
||||||
father_name.clear()
|
fields.append(driver.find_element(By.NAME, 'phone'))
|
||||||
name_field.send_keys('a')
|
time.sleep(1)
|
||||||
surname_field.send_keys('a')
|
for i in range(len(fields)):
|
||||||
father_name.send_keys('a')
|
fields[i].clear()
|
||||||
|
fields[i].send_keys('a')
|
||||||
|
assert driver.find_element(
|
||||||
|
By.XPATH, f"//*[@id='root']/div/div[1]/div[2]/div/div[2]/div[2]/div/div/form/div[{i + 1}]/div[3]").is_displayed()
|
||||||
|
driver.find_element(
|
||||||
|
By.XPATH, "//*[@id='root']/div/div[1]/div[2]/div/div[2]/div[2]/div/div/form/a[1]").click()
|
||||||
|
driver.find_element(
|
||||||
|
By.XPATH, "//*[@id='root']/div/div[1]/div[2]/div/div[2]/div[2]/div/form/div[3]/div[2]/input").send_keys('a')
|
||||||
|
assert driver.find_element(By.CLASS_NAME, 'disabled').is_enabled()
|
||||||
|
change_password = driver.find_element(
|
||||||
|
By.XPATH, "//*[@id='root']/div/div[1]/div[2]/div/div[2]/div[2]/div/div/form/a[2]")
|
||||||
|
driver.execute_script("arguments[0].scrollIntoView(true);", change_password)
|
||||||
|
change_password.click()
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user