Skip to content

Commit 18bb2a6

Browse files
committed
[test] fix race condition in issue3780-jailed
1 parent 6451d57 commit 18bb2a6

File tree

1 file changed

+13
-3
lines changed
  • test/sanity/issue3780-jailed

1 file changed

+13
-3
lines changed

test/sanity/issue3780-jailed/test.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,18 @@
2626
devtools_click_tab(driver, 'console')
2727
print 'send_keys "location.pathname<enter>"'
2828
devtools_type_in_console(driver, 'location.pathname\n')
29-
pathname = driver.find_element_by_css_selector('.console-user-command-result .console-message-text .object-value-string').get_attribute('textContent')
30-
print pathname
31-
assert ('/child.html' in pathname)
29+
timeout = 10
30+
while timeout > 0 :
31+
try:
32+
pathname = driver.find_element_by_css_selector('.console-user-command-result .console-message-text .object-value-string').get_attribute('textContent')
33+
print pathname
34+
assert ('/child.html' in pathname)
35+
break
36+
except selenium.common.exceptions.NoSuchElementException:
37+
pass
38+
time.sleep(1)
39+
timeout = timeout - 1
40+
if timeout <= 0:
41+
raise Exception('Timeout when waiting for result')
3242
finally:
3343
driver.quit()

0 commit comments

Comments
 (0)