ttrss: tests: functional: Fix to wait properly

- When subscribe button is clicked in subscribe dialog, the dialog does not
close immediately. Wait until it closes or error appears.

- When a feed is added, the feed list refreshes and during that time, it is not
possible to click on the feed expand button. Wait until it can be clicked.
Extend the eventually() method to wait on exceptions and not just false values.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-06-20 10:42:39 -04:00
1 parent f768840165
commit ae73b296de
2 files changed
+16 -4

No files matched your search

+5 -2
View File
@@ -64,8 +64,11 @@ def eventually(function, args=[], timeout=30):
end_time = time.time() + timeout
current_time = time.time()
while current_time < end_time:
if function(*args):
return True
try:
if function(*args):
return True
except Exception:
pass
time.sleep(0.1)
current_time = time.time()