diff --git a/automation-tests/persona_server/pages/home.py b/automation-tests/persona_server/pages/home.py index 50ef74beaa34c0b7e1c7b199ddef99932455e962..58b8281eda0ab94a32adfa9d548a8326c2a428d9 100644 --- a/automation-tests/persona_server/pages/home.py +++ b/automation-tests/persona_server/pages/home.py @@ -24,11 +24,11 @@ class HomePage(Base): def __init__(self, mozwebqa): Base.__init__(self, mozwebqa) - - WebDriverWait(self.selenium, self.timeout * 2).until( + longer_timeout = self.timeout * 2 + WebDriverWait(self.selenium, longer_timeout).until( lambda s: s.find_element(*self._sign_in_locator) and \ s.find_element(*self._sign_in_locator).is_displayed(), - "the sign in button has not appeared within %s" % self.timeout * 2) + "the sign in button has not appeared within %s" % longer_timeout) def click_sign_up(self): """Clicks the Sign Up button.""" diff --git a/automation-tests/persona_server/tests/base.py b/automation-tests/persona_server/tests/base.py index 8e175aa229192024ce3c221a7ed6efa5773d0b21..f955088f2277181be58575a1fd4be5079f8ed6f9 100644 --- a/automation-tests/persona_server/tests/base.py +++ b/automation-tests/persona_server/tests/base.py @@ -14,8 +14,13 @@ from persona_server.pages.account_manager import AccountManager class BaseTest(object): + def clear_browser(self, mozwebqa): + mozwebqa.selenium.execute_script('localStorage.clear()') + + # move this to BrowserID when personatestuser.org comes online def create_verified_user(self, mozwebqa): + '''Create a user, verify it, and return it.''' user = MockUser() # create the user @@ -33,6 +38,7 @@ class BaseTest(object): account_manager = AccountManager(mozwebqa) account_manager.load_page() account_manager.sign_out() + self.clear_browser(mozwebqa) home.load_page() # test will instantiate HomePage return user