Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Try to wait as little as possible, but still enough, for tests to pas…

…s on travis
  • Loading branch information...
commit 5819141d903e5697bedacc4ae72c8cdb60c40ee9 1 parent 64629c7
@jpic jpic authored
Showing with 15 additions and 4 deletions.
  1. +15 −4 session_security/tests/script.py
View
19 session_security/tests/script.py
@@ -22,7 +22,9 @@ def do_admin_login(self, username, password):
password_input = self.browser.find_element_by_name("password")
password_input.send_keys(password)
self.browser.find_element_by_xpath('//input[@value="Log in"]').click()
- self.browser.implicitly_wait(10)
+
+ while self.warning_element() is False:
+ time.sleep(0.1)
def press_space(self):
a = ActionChains(self.browser)
@@ -57,11 +59,11 @@ def test_single_window_inactivity(self):
def test_single_dont_show_warning(self):
self.press_space()
- time.sleep(4+1) # Added one seconds to compensate for fadeIn
+ time.sleep(3+1) # Added one seconds to compensate for fadeIn
self.assertWarningHidden()
def test_single_hide_warning(self):
- time.sleep(4+1) # Added one seconds to compensate for fadeIn
+ time.sleep(5+1) # Added one seconds to compensate for fadeIn
self.assertWarningShown()
self.press_space()
@@ -86,15 +88,24 @@ def test_double_window_inactivity(self):
def test_double_window_hide_warning(self):
self.browser.execute_script('window.open("/admin/", "other")')
+ self.browser.switch_to_window(self.browser.window_handles[1])
+ while self.warning_element() is False:
+ time.sleep(0.1)
+ self.browser.switch_to_window(self.browser.window_handles[0])
+
+ for win in self.browser.window_handles:
+ self.browser.switch_to_window(win)
+ self.assertWarningHidden()
time.sleep(5+1) # Added one seconds to compensate for fadeIn
for win in self.browser.window_handles:
self.browser.switch_to_window(win)
self.assertWarningShown()
+ time.sleep(3)
self.press_space()
-
time.sleep(4)
+
for win in self.browser.window_handles:
self.browser.switch_to_window(win)
self.assertWarningHidden()
Please sign in to comment.
Something went wrong with that request. Please try again.