Beispiel #1
0
    def test_login_invalid_empty_fields(self):
        driver = self.driver
        driver.get("http://medechat-client.qa.butterfly.com.au/")

        login = LoginPage(driver)
        login.enter_email("")
        login.enter_password("")
        login.click_login_invalid_empty_fields()
        time.sleep(2)
Beispiel #2
0
    def test_login_invalid_password(self):
        driver = self.driver
        driver.get("http://medechat-client.qa.butterfly.com.au/")

        login = LoginPage(driver)
        login.enter_email("*****@*****.**")
        login.enter_password("But3as2flying!")
        login.click_login_invalid_password()
        time.sleep(2)
    def test_02_invalid_login(self):
        driver = self.driver  # Setup driver variable to self.driver so no need to type self.driver each time
        home = HomePage(
            driver
        )  # A variable for home, driver instance passed because this argument added to construction of LoginPage
        login = LoginPage(
            driver
        )  # A variable for login, driver instance passed because this argument added to construction of LoginPage

        home.click_customer_login_link()  # Click on Login link
        login.enter_email('*****@*****.**')  # Enter the email
        login.enter_password('Tester1234')  # Enter the password
        login.click_on_sign_in_button()  # Click on submit button
        assert 'Incorrect email or password.' in driver.page_source  # Verify error is shown
    def test_01_valid_login(self):
        driver = self.driver  # Setup driver variable to self.driver so no need to type self.driver each time
        home = HomePage(
            driver
        )  # A variable for home, driver instance passed because this argument added to constructor of HomePage
        login = LoginPage(
            driver
        )  # A variable for login, driver instance passed because this argument added to constructor of LoginPage
        my_account = MyaccountPage(
            driver
        )  # A variable for my account, driver instance passed because this argument added to constructor of MyaccountPage

        home.click_customer_login_link()  # Click on Login link
        login.enter_email('*****@*****.**')  # Enter the email
        login.enter_password('Tester1234')  # Enter the password
        login.click_on_sign_in_button()  # Click on submit button
        self.assertEqual(
            my_account.get_section_header_text(),
            "My Account")  # Verify header of the page is My Account
        my_account.click_on_logout(
        )  # Need to sign out after this test for the next one