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

Commit

Permalink
Added a wait for the loading spinner to disappear when tapping next a…
Browse files Browse the repository at this point in the history
…fter you type the email.

It looks like some tests are failing because it tries to click the sign in button while the spinner is still displayed.
  • Loading branch information
chirarobert committed Jul 7, 2014
1 parent d3081b4 commit 539f538
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions browserid/pages/sign_in.py
Expand Up @@ -15,6 +15,7 @@
class SignIn(Base):

_form_completing_loading_locator = (By.CSS_SELECTOR, '.form.completing.loading')
_checking_email_provider_loading_locator = (By.CSS_SELECTOR, '#load .loadingSpinner')
_this_is_not_me_locator = (By.CSS_SELECTOR, '.isDesktop.thisIsNotMe')
_signed_in_email_locator = (By.CSS_SELECTOR, 'label[for=email_0]')
_emails_locator = (By.CSS_SELECTOR, 'label[for^=email_]')
Expand Down Expand Up @@ -171,6 +172,10 @@ def click_next(self, expect='password'):
else:
self.selenium.find_element(*self._mobile_next_locator).click()

WebDriverWait(self.selenium, self.timeout).until(
lambda s: not s.find_element(
*self._checking_email_provider_loading_locator).is_displayed())

if expect == 'password':
WebDriverWait(self.selenium, self.timeout).until(
lambda s: s.find_element(
Expand Down

0 comments on commit 539f538

Please sign in to comment.