Permalink
Browse files

Added a wait for the loading spinner to disappear when tapping next a…

…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...
1 parent d3081b4 commit 539f5388eb23f1366ff321adf38ca93edebbe641 @chirarobert chirarobert committed Jul 7, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 browserid/pages/sign_in.py
View
5 browserid/pages/sign_in.py
@@ -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_]')
@@ -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(

0 comments on commit 539f538

Please sign in to comment.