Exemple #1
0
 def test_login_failed(self):
     fake_user_name = '*****@*****.**'
     fake_user_password = "******"
     xpath = '//*[@ class = "alert alert-danger"]'
     expected_text = 'Authentication failed.'
     driver = self.ef_driver
     driver.get(self.login_url)
     fh.user_login(driver, fake_user_name, fake_user_password)
     self.assert_element_text(driver, xpath, expected_text)
 def test_login_to_my_account(self):
     user_name = 'xxx'
     user_password = '******'
     driver = self.driver
     driver.get(self.login_url)
     xpath = '//a[@class="account"]/*[@class="hidden-sm-down"]'
     expected_text = 'xxx'
     fh.user_login(driver, user_name, user_password)
     self.assert_element_text(driver, xpath, expected_text)
Exemple #3
0
 def test_login_to_my_account(self):
     user_name = '*****@*****.**'
     user_password = '******'
     driver = self.ef_driver
     driver.get(self.login_url)
     xpath = '//a[@class="account"]/*[@class="hidden-sm-down"]'
     expected_text = 'Barbara Kowalska'
     fh.user_login(driver, user_name, user_password)
     self.assert_element_text(driver, xpath, expected_text)
Exemple #4
0
 def test_failed_login_attempt(self):
     driver = self.driver
     driver.get(self.login_url)
     user_email = '*****@*****.**'
     user_password = '******'
     fh.user_login(driver, user_email, user_password)
     time.sleep(3)
     self.assert_element_text(driver, '//*[@class="alert alert-danger"]',
                              "Authentication failed.")
Exemple #5
0
 def test_incorrect_login(self):
     # expected_text is a warning message about authentication failed
     expected_text = 'Authentication failed.'
     alert_xpath = '//*[@class="alert alert-danger"]'
     user_email = '*****@*****.**'
     user_pass = '******'
     driver = self.ef_driver
     driver.get(self.login_url)
     fh.user_login(driver, user_email, user_pass)
     self.assert_element_text(driver, alert_xpath, expected_text)
Exemple #6
0
 def test_correct_login(self):
     # expected_text is a user name and user surname used during registration
     expected_text = 'Adam Testowy'
     user_name_xpath = '//a[@class="account"]/*[@class="hidden-sm-down"]'
     user_email = '*****@*****.**'
     user_pass = '******'
     driver = self.ef_driver
     driver.get(self.login_url)
     fh.user_login(driver, user_email, user_pass)
     self.assert_element_text(driver, user_name_xpath, expected_text)
Exemple #7
0
 def test_successful_login(self):
     driver = self.driver
     driver.get(self.login_url)
     user_email = '*****@*****.**'
     user_password = '******'
     fh.user_login(driver, user_email, user_password)
     time.sleep(3)
     self.assert_element_text(
         driver, '//*[@class="account"]/*[@class="hidden-sm-down"]',
         "TestDude TestMate")
Exemple #8
0
 def test_correct_login(self):
     # expected_text is a user name and user surname used during registration
     expected_text = 'TestDude TestMate'
     user_name_xpath = '//a[@class="account"]/*[@class="hidden-sm-down"]'
     user_email = '*****@*****.**'
     user_pass = '******'
     driver = self.ef_driver
     driver.get(self.login_url)
     fh.user_login(driver, user_email, user_pass)
     self.assert_element_text(driver, user_name_xpath, expected_text)
Exemple #9
0
    def test_incorrect_login(self):
        expected_text = 'Authentication failed.'
        user_email = '*****@*****.**'
        user_pass = '******'
        alert_xpath = '//*[@id="content"]/section/div/ul/li'

        driver = self.ef_driver
        driver.get(self.login_url)
        time.sleep(2)

        fh.user_login(driver, user_email, user_pass)
        self.assert_element_text(driver, alert_xpath, expected_text)
    def test_login_with_correct_login_and_password(self):
        """Checking log in to existing account with correct login and password."""
        expected_text = "Your account"
        driver = self.driver
        user_email = '*****@*****.**'
        user_password = '******'
        my_account_header_element_xpath = '//*[@class="page-header"]'

        driver.get(self.login_page_url)
        fh.user_login(driver, user_email, user_password)
        self.assert_element_text(driver, my_account_header_element_xpath,
                                 expected_text)
Exemple #11
0
    def test_correct_login(self):
        # expected_text is a user name and user surname used during registration
        expected_text = 'm s'
        user_email = '*****@*****.**'
        user_pass = '******'
        username_xpath = '//a[@class="account"]/*[@class="hidden-sm-down"]'

        driver = self.ef_driver
        driver.get(self.login_url)
        time.sleep(2)

        fh.user_login(driver, user_email, user_pass)
        self.assert_element_text(driver, username_xpath, expected_text)
    def test_login_with_incorrect_login_and_password(self):
        """Checking log in to existing account."""
        expected_error_text = "Authentication failed."
        driver = self.driver
        incorrect_user_email = '*****@*****.**'
        incorrect_user_pass = '******'
        my_account_login_error_xpath = '//*[@class = "alert alert-danger"]'

        driver.get(self.login_page_url)
        fh.user_login(driver, incorrect_user_email, incorrect_user_pass)
        time.sleep(1.5)
        self.assert_element_text(driver, my_account_login_error_xpath,
                                 expected_error_text)