mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
calibre: tests: functional: Use newer splinter API for finding links
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
e6b1fe6783
commit
2abe7315f9
@ -77,7 +77,7 @@ def _add_library(browser, name):
|
|||||||
if _is_library_available(browser, name):
|
if _is_library_available(browser, name):
|
||||||
return
|
return
|
||||||
|
|
||||||
browser.find_link_by_href(
|
browser.links.find_by_href(
|
||||||
'/plinth/apps/calibre/library/create/').first.click()
|
'/plinth/apps/calibre/library/create/').first.click()
|
||||||
browser.find_by_id('id_calibre-name').fill(name)
|
browser.find_by_id('id_calibre-name').fill(name)
|
||||||
functional.submit(browser)
|
functional.submit(browser)
|
||||||
@ -86,7 +86,7 @@ def _add_library(browser, name):
|
|||||||
def _delete_library(browser, name, ignore_missing=False):
|
def _delete_library(browser, name, ignore_missing=False):
|
||||||
"""Delete a library."""
|
"""Delete a library."""
|
||||||
functional.nav_to_module(browser, 'calibre')
|
functional.nav_to_module(browser, 'calibre')
|
||||||
link = browser.find_link_by_href(
|
link = browser.links.find_by_href(
|
||||||
f'/plinth/apps/calibre/library/{name}/delete/')
|
f'/plinth/apps/calibre/library/{name}/delete/')
|
||||||
if not link:
|
if not link:
|
||||||
if ignore_missing:
|
if ignore_missing:
|
||||||
@ -101,7 +101,7 @@ def _delete_library(browser, name, ignore_missing=False):
|
|||||||
def _is_library_available(browser, name):
|
def _is_library_available(browser, name):
|
||||||
"""Return whether a library is present in the list of libraries."""
|
"""Return whether a library is present in the list of libraries."""
|
||||||
functional.nav_to_module(browser, 'calibre')
|
functional.nav_to_module(browser, 'calibre')
|
||||||
link = browser.find_link_by_href(
|
link = browser.links.find_by_href(
|
||||||
f'/plinth/apps/calibre/library/{name}/delete/')
|
f'/plinth/apps/calibre/library/{name}/delete/')
|
||||||
return bool(link)
|
return bool(link)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user