Skip to content
Snippets Groups Projects

Resolve "Flaky Frontend tests"

Merged robinwilliam.hundt requested to merge 143-flaky-frontend-tests into master
6 files
+ 19
20
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -45,7 +45,7 @@ class TestAutoLogout(LiveServerTestCase):
def test_auto_logout_can_continue(self):
with self.settings(JWT_AUTH={
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=5),
'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=15),
'JWT_ALLOW_REFRESH': True,
}
):
@@ -54,12 +54,11 @@ class TestAutoLogout(LiveServerTestCase):
'return sessionStorage["token"]'
)
logout_dialog = self.browser.find_element_by_id('logout-dialog')
WebDriverWait(self.browser, 5).until(
WebDriverWait(self.browser, 15).until(
ec.visibility_of_element_located((By.ID, 'logout-dialog')))
logout_dialog.find_element_by_id('continue-btn').click()
# explicit sleep is unfortunately necessary here, since we need to wait
# for the initial token to expire and the site to be the same
time.sleep(2)
WebDriverWait(self.browser, 10).until(
ec.invisibility_of_element_located((By.ID, 'logout-dialog')))
self.assertNotIn('login', self.browser.current_url)
new_token = self.browser.execute_script(
'return sessionStorage["token"]'
Loading