Skip to content
Browse files

Add functions for reset password workflow

  • Loading branch information...
1 parent 377269d commit 6430c0534c6b3f5975925eae2de48609dad06294 Zac committed with Zac Jun 28, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 pages/webdriver/sign_in.py
View
16 pages/webdriver/sign_in.py
@@ -21,6 +21,8 @@ class SignIn(Base):
_sign_in_returning_user_locator = (By.ID, 'signInButton')
_verify_email_locator = (By.ID, 'verify_user')
_use_another_email_address_locator = (By.ID, 'back')
+ _forgot_password_locator = (By.ID, 'forgotPassword')
+ _reset_password_locator = (By.ID, 'password_reset')
def __init__(self, selenium, timeout, expect='new'):
Base.__init__(self, selenium, timeout)
@@ -120,6 +122,20 @@ def click_verify_email(self):
lambda s: s.find_element(
*self._use_another_email_address_locator).is_displayed())
+ def click_forgot_password(self):
+ """Clicks 'forgot password' link (visible after entering a valid email)"""
+ self.selenium.find_element(*self._forgot_password_locator).click()
+ WebDriverWait(self.selenium, self.timeout).until(
+ lambda s: s.find_element(
+ *self._reset_password_locator).is_displayed())
+
+ def click_reset_password(self):
+ """Clicks 'reset password' after forgot password and new passwords entered"""
+ self.selenium.find_element(*self._reset_password_locator).click()
+ WebDriverWait(self.selenium, self.timeout).until(
+ lambda s: s.find_element(
+ *self._use_another_email_address_locator).is_displayed())
+
def sign_in(self, email, password):
"""Signs in using the specified email address and password."""
self.email = email

0 comments on commit 6430c05

Please sign in to comment.
Something went wrong with that request. Please try again.