mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
calibre: tests: functional: Fix occasional failure in add book test
- When a library is added to using the FreedomBox interface and immediately Calibre interface is loaded, the library does not immediately get listed in the list of libraries. We will have to fresh the page to see the new library. Do this. Tests: - Run functional tests for calibre on Testing distribution multiple times without failures. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
fc86f3e507
commit
4bc13f063f
@ -105,8 +105,17 @@ def _visit_library(browser, name):
|
||||
|
||||
functional.eventually(_service_available)
|
||||
|
||||
functional.eventually(browser.find_by_css,
|
||||
args=[f'.calibre-push-button[data-lid="{name}"]'])
|
||||
def _library_available():
|
||||
"""Refresh until the expected library is available."""
|
||||
available = browser.find_by_css(
|
||||
f'.calibre-push-button[data-lid="{name}"]')
|
||||
if not available:
|
||||
time.sleep(0.5)
|
||||
functional.visit(browser, '/calibre')
|
||||
|
||||
return available
|
||||
|
||||
functional.eventually(_library_available)
|
||||
link = browser.find_by_css(f'.calibre-push-button[data-lid="{name}"]')
|
||||
if not link:
|
||||
raise ValueError('Library not found')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user