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 4a4e036dcd5f77c254beec95328d2d8132ca1216..89d6e9c61d117cc667d891d093ef21524a728e3e 100644 --- a/automation-tests/browserid/pages/account_manager.py +++ b/automation-tests/browserid/pages/account_manager.py @@ -43,7 +43,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): @@ -55,7 +55,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 b52bde2ee9126f5fbaf10d86c860eff24d5f6ebe..62fcffaf116ac6bfd30a904615d61080c400b51e 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): @@ -32,6 +32,7 @@ class TestSignIn(BaseTest): 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 78fe844a3592054db2c5c719b1d60c892fac5827..b7e791642df9d27d42be8bee05f5c2be048ae8fd 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