Skip to content
Snippets Groups Projects
Commit 65a3287a authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

Merge pull request #2452 from klrmn/fix_window_close_error

attempt to fix window switch / close errors
parents 078238c6 34db87c3
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,9 @@ class SignIn(Base):
def __init__(self, selenium, timeout, expect='new'):
Base.__init__(self, selenium, timeout)
# wait for second window to open
WebDriverWait(self.selenium, self.timeout).until(
lambda s: s.window_handles > 1)
selenium.switch_to_window('__persona_dialog')
if expect == 'new':
......@@ -50,7 +53,11 @@ class SignIn(Base):
raise Exception('Unknown expect value: %s' % expect)
def close_window(self):
self.selenium.close()
try: # race condition with window closing by itself
self.selenium.close()
except:
# if it fails, the framework will capture a screenshot
pass
@property
def signed_in_email(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment