mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
transmission: tests: functional: Fix to wait properly
When the page is initially loaded, torrents don't appear. It is later loaded using an AJAX call. Wait until we find the torrents we need. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
bc6b24247d
commit
f768840165
@ -26,7 +26,9 @@ def transmission_upload_sample_torrent(session_browser):
|
|||||||
parsers.parse(
|
parsers.parse(
|
||||||
'there should be {torrents_number:d} torrents listed in transmission'))
|
'there should be {torrents_number:d} torrents listed in transmission'))
|
||||||
def transmission_assert_number_of_torrents(session_browser, torrents_number):
|
def transmission_assert_number_of_torrents(session_browser, torrents_number):
|
||||||
assert torrents_number == _get_number_of_torrents(session_browser)
|
functional.visit(session_browser, '/transmission')
|
||||||
|
assert functional.eventually(
|
||||||
|
lambda: torrents_number == _get_number_of_torrents(session_browser))
|
||||||
|
|
||||||
|
|
||||||
def _remove_all_torrents(browser):
|
def _remove_all_torrents(browser):
|
||||||
@ -65,5 +67,4 @@ def _upload_sample_torrent(browser):
|
|||||||
|
|
||||||
def _get_number_of_torrents(browser):
|
def _get_number_of_torrents(browser):
|
||||||
"""Return the number torrents currently in transmission."""
|
"""Return the number torrents currently in transmission."""
|
||||||
functional.visit(browser, '/transmission')
|
|
||||||
return len(browser.find_by_css('#torrent_list .torrent'))
|
return len(browser.find_by_css('#torrent_list .torrent'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user