def login_as_admin(self): driver = self.app.driver self.app.pages.open_main_page() self.app.session.login(LoginCred(username="******", password="******")) driver.refresh() driver.get(self.app.selectors.site_admin) self.app.warning.wait_for_element_xpath(self.app.selectors.user_button)
def test_see_password(app): with pytest.allure.step("Open main page"): app.pages.open_main_page() with pytest.allure.step("Fill fields with correct data"): app.session.fill_fields_see_password( LoginCred(username="******", password="******")) with pytest.allure.step("Password is visible"): assert app.warning.get_value( xpath="(//input[@name='password'])[2]") == "TestTest12"
def open_cash_page(self): driver = self.app.driver self.open_main_page() self.app.session.login( LoginCred(username="******", password="******")) time.sleep(1) driver.find_element_by_xpath(self.app.selectors.cash_button).click() assert self.app.warning.get_outer_text( self.app.selectors.page_header_h2) == "ПОПОЛНИТЬ"
def test_open_slot_page(app): with pytest.allure.step("Open main page"): app.open_main_page_ru() with pytest.allure.step("Login to triced user"): app.session.login(LoginCred(username="******", password="******")) with pytest.allure.step("Open slots page"): app.pages.open_slots_page() with pytest.allure.step("Check that poker button is display"): assert app.session.element_is_display(app.selectors.poker_button)
def test_login_nick_space_before(app): with pytest.allure.step("Open main page"): app.pages.open_main_page() with pytest.allure.step("Login with space before nickname"): app.session.login(LoginCred(username="******", password="******")) with pytest.allure.step("Assert to number of logout button"): assert len( app.driver.find_elements_by_xpath("//a[@href='/logout/']")) > 0 with pytest.allure.step("Ensure Login"): app.session.ensure_login(username="******") with pytest.allure.step("Logout"): app.session.logout()
def test_login_email_caps(app): with pytest.allure.step("Open main page"): app.pages.open_main_page() with pytest.allure.step("Login with email Caps"): app.session.login( LoginCred(username="******".upper(), password="******")) with pytest.allure.step("Assert to number of logout button"): assert len( app.driver.find_elements_by_xpath("//a[@href='/logout/']")) > 0 with pytest.allure.step("Ensure Login"): app.session.ensure_login(username="******") with pytest.allure.step("Logout"): app.session.logout()
def test_empty_fields(app): with pytest.allure.step("Login with empty fields"): app.session.login(LoginCred(username="", password="")) with pytest.allure.step("Enter captcha if it visible"): app.session.captcha_entering() with pytest.allure.step("Nickname warning message"): assert app.warning.get_outer_text( "(//input[@name='password'])[2]/following::div[1]" ) == "Почта или пароль указаны неверно" with pytest.allure.step("Password field's boarder color Assert"): assert app.warning.get_border_color( "//div[@id='login']//input[@name='password'][2]" ) == "rgba(187, 37, 37, 1)" with pytest.allure.step("Login field's boarder color Assert"): assert app.warning.get_border_color( "//input[@name='login']") == "rgba(187, 37, 37, 1)" with pytest.allure.step("Close login pop-up by close(x) button"): app.driver.find_element_by_xpath( "//div[@id='login']//button[@aria-label='Close']").click()