diff --git a/automation-tests/browserid/README.md b/automation-tests/browserid/README.md index df702c27ced028d9a83ae20ef4494914525b6b7a..5e4f0436395ce6b3d02aa0ea3c7f8694c1c78403 100644 --- a/automation-tests/browserid/README.md +++ b/automation-tests/browserid/README.md @@ -6,6 +6,12 @@ Documentation ------------- See the project's [wiki](https://github.com/mozilla/bidpom/wiki). +Running BIDPOM's Tests +---------------------- +* two tests in check_sign_in.py require --email and --password flags. they can be skipped by using the "-m travis" flag +* if running against a remote selenium server, add --capabilities={"avoid-proxy":true} to the command line +* if experiencing TimeoutErrors from WebDriverWait, add the --webqatimeout=90 to the command line + License ------- This software is licensed under the [MPL](http://www.mozilla.org/MPL/2.0/) 2.0: diff --git a/automation-tests/browserid/pages/account_manager.py b/automation-tests/browserid/pages/account_manager.py index 3b97ce51193a4cfc4f2ca583878350541755f78d..74595fe65d912504ff3b3fe25200a5bfae635a78 100644 --- a/automation-tests/browserid/pages/account_manager.py +++ b/automation-tests/browserid/pages/account_manager.py @@ -45,7 +45,7 @@ class AccountManager(Base): @property def old_password(self): """Get the value of the old password field.""" - return self.selenium.find_element(*self._old_password_field_locator).text + return self.selenium.find_element(*self._old_password_field_locator).get_attribute('value') @old_password.setter def old_password(self, value): @@ -57,7 +57,7 @@ class AccountManager(Base): @property def new_password(self): """Get the value of the new password field.""" - return self.selenium.find_element(*self._new_password_field_locator).text + return self.selenium.find_element(*self._new_password_field_locator).get_attribute('value') @new_password.setter def new_password(self, value): diff --git a/automation-tests/browserid/pages/sign_in.py b/automation-tests/browserid/pages/sign_in.py index 13df85c42538207f6bf452a936cee412e2aea1d5..3f374bc2440eaa1f2333d026004ade685f359e1c 100644 --- a/automation-tests/browserid/pages/sign_in.py +++ b/automation-tests/browserid/pages/sign_in.py @@ -62,7 +62,7 @@ class SignIn(Base): @property def signed_in_email(self): """Get the value of the email that is currently signed in.""" - return self.selenium.find_element(*self._signed_in_email_locator).text + return self.selenium.find_element(*self._signed_in_email_locator).get_attribute('value') def click_this_is_not_me(self): """Clicks the 'This is not me' button.""" @@ -79,7 +79,7 @@ class SignIn(Base): @property def email(self): """Get the value of the email field.""" - return self.selenium.find_element(*self._email_locator).text + return self.selenium.find_element(*self._email_locator).get_attribute('value') @email.setter def email(self, value): @@ -91,7 +91,7 @@ class SignIn(Base): @property def new_email(self): """Get the value of the new email field.""" - return self.selenium.find_element(*self._new_email_locator).text + return self.selenium.find_element(*self._new_email_locator).get_attribute('value') @new_email.setter def new_email(self, value): @@ -119,7 +119,7 @@ class SignIn(Base): @property def password(self): """Get the value of the password field.""" - return self.selenium.find_element(*self._password_locator).text + return self.selenium.find_element(*self._password_locator).get_attribute('value') @password.setter def password(self, value): @@ -131,7 +131,7 @@ class SignIn(Base): @property def verify_password(self): """Get the value of the verify password field.""" - return self.selenium.find_element(*self._verify_password_locator).text + return self.selenium.find_element(*self._verify_password_locator).get_attribute('value') @verify_password.setter def verify_password(self, value): diff --git a/automation-tests/browserid/tests/check_add_email.py b/automation-tests/browserid/tests/check_add_email.py index 79e1e00f9be379298ef5a7654125f8a9736c8a92..a8b54426dcb8c376d3432cf684655bd48eaec37e 100644 --- a/automation-tests/browserid/tests/check_add_email.py +++ b/automation-tests/browserid/tests/check_add_email.py @@ -14,7 +14,7 @@ import restmail @pytest.mark.nondestructive -class TestSignIn(BaseTest): +class TestAddEmail(BaseTest): @pytest.mark.travis def test_add_email(self, mozwebqa): @@ -29,6 +29,7 @@ class TestSignIn(BaseTest): signin = SignIn(mozwebqa.selenium, mozwebqa.timeout, expect='returning') signin.click_add_another_email_address() signin.new_email = user.additional_emails[0] + assert signin.new_email == user.additional_emails[0], "new email getter failed" signin.click_add_new_email() signin.close_window() signin.switch_to_main_window() diff --git a/automation-tests/browserid/tests/check_change_password.py b/automation-tests/browserid/tests/check_change_password.py index cb9e0501ae30a8c8b2b509e0b65c78caa649e586..1d74279ec2c0cb7e43214acc9b946ac0e27fd75e 100644 --- a/automation-tests/browserid/tests/check_change_password.py +++ b/automation-tests/browserid/tests/check_change_password.py @@ -12,7 +12,7 @@ from base import BaseTest @pytest.mark.nondestructive -class TestSignIn(BaseTest): +class TestChangePassword(BaseTest): @pytest.mark.travis def test_change_password(self, mozwebqa): @@ -26,8 +26,10 @@ class TestSignIn(BaseTest): account_manager.click_edit_password() account_manager.old_password = user.password + assert account_manager.old_password == user.password, "old password getter failed" user.password += '_new' account_manager.new_password = user.password + assert account_manager.new_password == user.password, "new password getter failed" account_manager.click_password_done() account_manager.click_sign_out() diff --git a/automation-tests/browserid/tests/check_reset_password.py b/automation-tests/browserid/tests/check_reset_password.py index 6dced83572eded7d8ac17a8b7cdd173f22cd9f8e..a8cd17cf55d2afc4b1a6d71d99f07682b8b4b47e 100644 --- a/automation-tests/browserid/tests/check_reset_password.py +++ b/automation-tests/browserid/tests/check_reset_password.py @@ -14,7 +14,7 @@ import restmail @pytest.mark.nondestructive -class TestSignIn(BaseTest): +class TestResetPassword(BaseTest): @pytest.mark.travis def test_reset_password(self, mozwebqa): diff --git a/automation-tests/browserid/tests/check_sign_in.py b/automation-tests/browserid/tests/check_sign_in.py index c273555cc7e0d027cc69be194cd1066eff55e9bd..8da48a5e5e8c68a32e2ee39907f9d7cfbed68f23 100644 --- a/automation-tests/browserid/tests/check_sign_in.py +++ b/automation-tests/browserid/tests/check_sign_in.py @@ -32,8 +32,10 @@ class TestSignIn(BaseTest): from .. pages.sign_in import SignIn signin = SignIn(mozwebqa.selenium, mozwebqa.timeout, expect='new') signin.email = credentials['email'] + assert signin.email == credentials['email'], "email getter failed" signin.click_next(expect='password') signin.password = credentials['password'] + assert signin.password == credentials['password'], "password getter failed" signin.click_sign_in() WebDriverWait(mozwebqa.selenium, mozwebqa.timeout).until( @@ -59,6 +61,7 @@ class TestSignIn(BaseTest): signin.click_next(expect='verify') signin.password = user.password signin.verify_password = user.password + assert signin.verify_password == user.password, 'verify password getter failed' signin.click_verify_email() assert signin.check_email_at_address == user.primary_email