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

Commit

Permalink
Improve wait for page to be ready when returning user
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Nov 12, 2015
1 parent 2a01b05 commit 9220db6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions browserid/pages/sign_in.py
Expand Up @@ -55,9 +55,12 @@ def __init__(self, selenium, timeout=10):
WebDriverWait(self.selenium, self.timeout).until(self._is_page_ready)

def _is_page_ready(self, s):
is_page_ready = s.find_element(*self._email_locator).is_displayed() or \
s.find_element(*self._sign_in_returning_user_locator).is_displayed()
return is_page_ready
if s.find_element(*self._email_locator).is_displayed():
return True
else:
body = self.selenium.find_element(By.TAG_NAME, 'body')
sign_in = s.find_element(*self._sign_in_returning_user_locator)
return sign_in.is_displayed() and 'submit_disabled' not in body.get_attribute('class')

@property
def is_initial_sign_in(self):
Expand Down

0 comments on commit 9220db6

Please sign in to comment.