А

Size: a a a
А
SR
А
А
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
class BasePage:
def __init__(self, driver):
self.driver = driver
def __element(self, selectors: dict):
for search_type in selectors.keys():
try:
return self.driver.find_element(getattr(By, search_type), selectors[search_type])
except NoSuchElementException:
print('\nERROR: SELECTOR ' + selectors[search_type] + ' IN ' + search_type + ' IS FALSE')
continue
except AttributeError:
print('\nERROR: ATTRIBUTE ERROR OF BY.')
continue
raise NoSuchElementException
def _click(self, selector):
ActionChains(self.driver).move_to_element(self.__element(selector)).click().perform()
А
class Login:
class Auth:
email = {'CSS_SELECTOR': "#inputEmail",
'XPATH': '//input[@id="inputEmail"]'}
password = {'CSS_SELECTOR': "#inputPassword",
'XPATH': '//input[@id="inputPassword"]'}
login_button = {'CSS_SELECTOR': "button[type='submit']",
'XPATH': '//span[@class="btn-text"]'}
А
from .BasePage import BasePage
from locators import Login
class LoginPage(BasePage):
def click_log_in(self):
self._click(Login.Auth.login_button)
def login_user(self, email, password):
self._input(Login.Auth.email, email)
self._input(Login.Auth.password, password)
А
А
P
Allure.getLifecycle().updateTestCase(testResult -> testResult.getLabels().add(new Label().setName(ResultsUtils.OWNER_LABEL_NAME).setValue("tester #1"))
`АФ
AS
СС
OC
@dataclass
class SomePage:
button: tuple = (By.XPATH, ".////.")
OC
DR
СС
АФ
А
СС
СС