def login(driver, admin): """Вход в систему""" page = AuthPage(driver) page.username = admin.login page.password = admin.password page.click_login_button() yield
def setUp(self): browser = os.environ.get('BROWSER', os.environ['BROWSER']) self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=getattr( DesiredCapabilities, browser).copy()) self.driver.maximize_window() self.MESSAGE_TEXT = "testNumber1" self.BOT_1_LOGIN = "******" self.BOT_2_LOGIN = "******" self.PASSWORD = os.environ['PASSWORD'] self.CURRENT_DIALOG_URL = "" self.dialog_page = DialogPage(self.driver) self.message_page = MessagePage(self.driver) self.auth_page = AuthPage(self.driver) self.auth_page.sign_in(self.BOT_1_LOGIN, self.PASSWORD) self.main_page = MainPage(self.driver) self.main_page.open_messages() self.URL_OF_DIALOG_WITH_ME = "https://ok.ru/messages/575662066926" self.URL_OF_MESSAGES = "https://ok.ru/messages" self.NEED_TO_BLOCK_USER = False self.NEED_TO_CHANGE_ACC = False self.create_dialog() self.CURRENT_DIALOG_URL = self.driver.current_url
def test_UserLogin(browser): load_dotenv() username = os.getenv('USERNAME') nav = HeaderNav(browser) auth = AuthPage(browser) nav.navigate_to('signin') auth.input_login_credentials() auth.click_sigin_button() assert nav.verify_user_login(username)
def test_signin_existing_user(self, admin): user = admin page = AuthPage(self.driver) page.username = user.login page.password = user.password page = page.click_login_button() assert page.user_is_signin()
def setUp(self): # browser = os.environ.get('BROWSER', 'FIREFOX') browser = os.environ.get('BROWSER', 'CHROME') self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=getattr( DesiredCapabilities, browser).copy()) self.send_message = False auth_page = AuthPage(self.driver) auth_page.sign_in(self.USEREMAIL, self.PASSWORD)
def setUp(self): browser = os.environ.get('BROWSER', 'FIREFOX') self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=getattr( DesiredCapabilities, browser).copy()) print 'setUp' auth_page = AuthPage(self.driver) auth_page.sign_in("technopark2", "testQA1") main_page = MainPage(self.driver) main_page.open_messages() # Open chat's window
def setUp(self): # browser = os.environ.get('BROWSER', 'FIREFOX') browser = os.environ.get('BROWSER', 'CHROME') self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=getattr( DesiredCapabilities, browser).copy()) auth_page = AuthPage(self.driver) auth_page.sign_in(self.USEREMAIL, self.PASSWORD) main_page = MainPage(self.driver) self.assertEqual(self.USERNAME, main_page.get_username(), "Usernames are not the same")
def setUp(self): # browser = os.environ.get('BROWSER', 'FIREFOX') browser = os.environ.get('BROWSER', 'CHROME') # Create a desired capabilities object as a starting point. capabilities = DesiredCapabilities.CHROME.copy() capabilities['platform'] = "ANY" capabilities['version'] = "" self.driver = Remote(command_executor='http://172.20.10.2:5555/wd/hub', desired_capabilities=capabilities) auth_page = AuthPage(self.driver) auth_page.sign_in(self.USERNAME, self.PASSWORD) main_page = MainPage(self.driver)
def test_logged_user_cannot_login_using_direct_link(browser): register_new_user(browser, get_account()) page = AuthPage(browser).open() assert 'My account'.upper() == page.title
def test_recover_password_navigate_back_breadcrumb(password_page): index = password_page.nav_items.index('Authentication') password_page.navigate(index) expected_page = AuthPage(password_page.driver) assert 'Authentication'.upper() == expected_page.title
def auth_page(browser) -> AuthPage: return AuthPage(browser).open()
def click_logout_button(self): self._click(NavBlockLocators.LOG_OUT_LINK_LOCATOR) self.alert_accept() from pages.auth import AuthPage return AuthPage(self._driver)