Skip to content

Commit 7c10a60

Browse files
committed
[fix] Removed sleep with selenium expected condition
1 parent fe8abc3 commit 7c10a60

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/runtests.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,14 @@ def test_forgot_password(self):
322322
"""Test forgot password to ensure that postfix is working properly."""
323323

324324
self.logout()
325-
time.sleep(0.3)
325+
try:
326+
WebDriverWait(self.base_driver, 3).until(
327+
EC.text_to_be_present_in_element(
328+
(By.CSS_SELECTOR, ".title-wrapper h1"), "Logged out"
329+
)
330+
)
331+
except TimeoutException:
332+
self.fail("Logout failed.")
326333
self.open("/accounts/password/reset/")
327334
self.find_element(By.NAME, "email").send_keys("admin@example.com")
328335
self.find_element(By.CSS_SELECTOR, 'button[type="submit"]').click()

0 commit comments

Comments
 (0)