Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix getters

* change getters from .text to .get_attribute('value')
* add tests for getters
* change test class names to match file names
* add some notes about running the tests to README
  • Loading branch information...
commit cbc4fe0acdb62de9ce6f448c589a7f318b4c27e1 1 parent 4c10bb2
Leah Klearman klrmn authored
6 README.md
View
@@ -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:
4 pages/account_manager.py
View
@@ -43,7 +43,7 @@ def click_edit_password(self):
@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 @@ def old_password(self, value):
@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):
10 pages/sign_in.py
View
@@ -62,7 +62,7 @@ def close_window(self):
@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 @@ def emails(self):
@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 @@ def email(self, value):
@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 @@ def select_email(self, value):
@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 @@ def password(self, value):
@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):
3  tests/check_add_email.py
View
@@ -14,7 +14,7 @@
@pytest.mark.nondestructive
-class TestSignIn(BaseTest):
+class TestAddEmail(BaseTest):
@pytest.mark.travis
def test_add_email(self, mozwebqa):
@@ -29,6 +29,7 @@ def test_add_email(self, mozwebqa):
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()
4 tests/check_change_password.py
View
@@ -12,7 +12,7 @@
@pytest.mark.nondestructive
-class TestSignIn(BaseTest):
+class TestChangePassword(BaseTest):
@pytest.mark.travis
def test_change_password(self, mozwebqa):
@@ -26,8 +26,10 @@ def test_change_password(self, mozwebqa):
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()
2  tests/check_reset_password.py
View
@@ -14,7 +14,7 @@
@pytest.mark.nondestructive
-class TestSignIn(BaseTest):
+class TestResetPassword(BaseTest):
@pytest.mark.travis
def test_reset_password(self, mozwebqa):
3  tests/check_sign_in.py
View
@@ -28,8 +28,10 @@ def test_sign_in(self, mozwebqa):
from .. pages.sign_in import SignIn
signin = SignIn(mozwebqa.selenium, mozwebqa.timeout, expect='new')
signin.email = mozwebqa.email
+ assert signin.email == mozwebqa.email, "email getter failed"
signin.click_next(expect='password')
signin.password = mozwebqa.password
+ assert signin.password == mozwebqa.password, "password getter failed"
signin.click_sign_in()
WebDriverWait(mozwebqa.selenium, mozwebqa.timeout).until(
@@ -55,6 +57,7 @@ def test_sign_in_new_user(self, mozwebqa):
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
Please sign in to comment.
Something went wrong with that request. Please try again.