diff --git a/src/functional_tests/test_admin.py b/src/functional_tests/test_admin.py index 9f73b9a..898652e 100644 --- a/src/functional_tests/test_admin.py +++ b/src/functional_tests/test_admin.py @@ -20,9 +20,15 @@ class AdminLoginTest(FunctionalTest): self.browser.find_element(By.ID, "id_password").send_keys("correct-password") self.browser.find_element(By.CSS_SELECTOR, "input[type=submit]").click() - body = self.wait_for( - lambda: self.browser.find_element(By.TAG_NAME, "body") - ) - self.assertIn("Site administration", body.text) + # Wait on the post-login content, not on `body` itself — body exists + # on the login page too, so a slow CI runner can grab the pre-submit + # body before the form submit navigates and miss `Site administration` + # entirely. Pipeline #300 ate this flake; locally the submit always + # completes first. wait_for retries on AssertionError up to MAX_WAIT. + self.wait_for(lambda: self.assertIn( + "Site administration", + self.browser.find_element(By.TAG_NAME, "body").text, + )) + body = self.browser.find_element(By.TAG_NAME, "body") self.assertIn("Users", body.text) self.assertIn("Tokens", body.text)