Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Add functions for reset password workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac authored and Zac committed Jul 5, 2012
1 parent 377269d commit 6430c05
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pages/webdriver/sign_in.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class SignIn(Base):
_sign_in_returning_user_locator = (By.ID, 'signInButton') _sign_in_returning_user_locator = (By.ID, 'signInButton')
_verify_email_locator = (By.ID, 'verify_user') _verify_email_locator = (By.ID, 'verify_user')
_use_another_email_address_locator = (By.ID, 'back') _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'): def __init__(self, selenium, timeout, expect='new'):
Base.__init__(self, selenium, timeout) Base.__init__(self, selenium, timeout)
Expand Down Expand Up @@ -120,6 +122,20 @@ def click_verify_email(self):
lambda s: s.find_element( lambda s: s.find_element(
*self._use_another_email_address_locator).is_displayed()) *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): def sign_in(self, email, password):
"""Signs in using the specified email address and password.""" """Signs in using the specified email address and password."""
self.email = email self.email = email
Expand Down

0 comments on commit 6430c05

Please sign in to comment.