コード例 #1
0
    def test_login_valid(self):
        driver = self.driver

        # * Actions on login web-page
        driver.get(test_link)
        login_page = LoginPage(driver)
        login_page.enter_login(username)
        login_page.enter_password(password)
        login_page.click_submit()

        # self.assertIn("ukr.net", driver.title)
        # # driver.maximize_window()
        # # driver.implicitly_wait(10)
        # login_field = WebDriverWait(driver, 10).until(
        #     EC.element_to_be_clickable((By.ID, "id-l"))
        # )
        # # login_field.screenshot("./login_field_image.png")
        # login_field.send_keys(login)
        # driver.find_element_by_id("id-p").send_keys(password)
        # driver.find_element_by_xpath("//button[@type='submit']").click()

        # # * Actions on home web-page
        home_page = HomePage(driver)
        home_page.click_menu()
        home_page.click_logout()

        # driver.find_element_by_class_name("login-button__control").click()
        # driver.find_element_by_id("login__logout").click()
        # # driver.save_screenshot("./mailbox_image.png")
        time.sleep(3)
コード例 #2
0
    def test_login_invalid(self):
        driver = self.driver

        # * Actions on login web-page
        driver.get(test_link)
        login_page = LoginPage(driver)
        login_page.enter_login("test123")
        login_page.enter_password(password)
        login_page.click_submit()
        message = driver.find_element_by_xpath("").text()
        self.assertEqual(message, "Неправильні дані")
コード例 #3
0
    def test_01_login_by_valid_account(self):
        driver = self.driver
        driver.get('https://slack.com')
        login = LoginPage(driver)

        domain_name = 'loctesting'
        domain_url = 'https://' + domain_name + '.slack.com/'

        login.click_signin()
        login.enter_domain(domain_name)
        login.click_submit()
        login.verify_domain(domain_url)

        time.sleep(2)
コード例 #4
0
    def test_001_login_valid(self):
        driver = self.driver

        # * Actions on login web-page
        driver.get(test_link)
        login_page = LoginPage(driver)
        login_page.enter_login(username)
        login_page.enter_password(password)
        login_page.click_submit()

        # # * Actions on home web-page
        home_page = HomePage(driver)
        home_page.click_menu()
        home_page.click_logout()
        time.sleep(3)