From 78941db1804299c3fb7ad61f19b917e0b9e06212 Mon Sep 17 00:00:00 2001
From: Leah Klearman <lklrmn@gmail.com>
Date: Tue, 14 Aug 2012 16:27:20 -0700
Subject: [PATCH] works for WinXP + IE8

---
 automation-tests/persona_server/pages/home.py | 6 +++---
 automation-tests/persona_server/tests/base.py | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/automation-tests/persona_server/pages/home.py b/automation-tests/persona_server/pages/home.py
index 50ef74bea..58b8281ed 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 8e175aa22..f955088f2 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
-- 
GitLab