Example #1
0
    def test_03_invalid_login(self):
        driver = self.driver
        home = HomePage(driver)
        login = LogInPage(driver)

        home.click_login_link_from_home()
        login.enter_customer_email(settings.CUSTOMER_INVALID_EMAIL)
        login.enter_customer_password(settings.CUSTOMER_PASSWORD)
        login.click_sign_in_button()
        time.sleep(2)
        assert 'Incorrect email or password.' in driver.page_source
Example #2
0
    def test_02_valid_login(self):
        driver = self.driver
        home = HomePage(driver)
        login = LogInPage(driver)
        my_account = MyAccountPage(driver)

        home.click_login_link_from_home()
        WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.ID, "CustomerEmail")))
        login.enter_customer_email(settings.CUSTOMER_EMAIL)
        login.enter_customer_password(settings.CUSTOMER_PASSWORD)
        login.click_sign_in_button()
        my_account.check_my_account_page_header()
        my_account.check_account_details_is_shown()
        my_account.click_log_out()