mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
miniflux: tests: functional: Use helper functions from functional libary
Also, ignore pexpect module in mypy checks. Tests: - All miniflux tests pass. Signed-off-by: Veiko Aasa <veiko17@disroot.org> [sunil: Update to reflect the new utility function name] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
92c35e4640
commit
eca6a65080
@ -34,9 +34,7 @@ class TestMinifluxApp(functional.BaseAppTests):
|
||||
"""Test creating an admin user."""
|
||||
_miniflux_login(session_browser)
|
||||
# Verify that this user can see admin settings
|
||||
with functional.wait_for_page_update(session_browser):
|
||||
session_browser.links.find_by_href(
|
||||
'/miniflux/settings').first.click()
|
||||
functional.click_link_by_href(session_browser, '/miniflux/settings')
|
||||
|
||||
assert not session_browser.links.find_by_href(
|
||||
'/miniflux/users').is_empty()
|
||||
@ -61,9 +59,7 @@ class TestMinifluxApp(functional.BaseAppTests):
|
||||
def _fill_credentials_form(browser, href):
|
||||
"""Fill the user credentials form in Miniflux app."""
|
||||
functional.nav_to_module(browser, 'miniflux')
|
||||
with functional.wait_for_page_update(browser):
|
||||
browser.links.find_by_href(
|
||||
f'/plinth/apps/miniflux/{href}/').first.click()
|
||||
functional.click_link_by_href(browser, f'/plinth/apps/miniflux/{href}/')
|
||||
|
||||
browser.fill('miniflux-username', CREDENTIALS['username'])
|
||||
browser.fill('miniflux-password', CREDENTIALS['password'])
|
||||
@ -89,8 +85,7 @@ def _miniflux_logout(browser):
|
||||
_open_miniflux_app(browser)
|
||||
maybe_logout_button = browser.links.find_by_href('/miniflux/logout')
|
||||
if not maybe_logout_button.is_empty():
|
||||
with functional.wait_for_page_update(browser):
|
||||
maybe_logout_button.first.click()
|
||||
functional.click_and_wait(browser, maybe_logout_button)
|
||||
|
||||
|
||||
def _miniflux_submit(browser):
|
||||
@ -117,19 +112,15 @@ def _subscribe(browser, feed_url):
|
||||
"""Subscribe to a feed in Miniflux."""
|
||||
_open_miniflux_app(browser)
|
||||
_miniflux_login(browser)
|
||||
with functional.wait_for_page_update(browser):
|
||||
browser.links.find_by_href('/miniflux/subscribe').first.click()
|
||||
|
||||
with functional.wait_for_page_update(browser):
|
||||
browser.find_by_id('form-url').fill(feed_url)
|
||||
_miniflux_submit(browser)
|
||||
functional.click_link_by_href(browser, '/miniflux/subscribe')
|
||||
browser.find_by_id('form-url').fill(feed_url)
|
||||
_miniflux_submit(browser)
|
||||
|
||||
|
||||
def _is_subscribed(browser, feed_name):
|
||||
"""Check if the user is subscribed to a feed."""
|
||||
_open_miniflux_app(browser)
|
||||
_miniflux_login(browser)
|
||||
with functional.wait_for_page_update(browser):
|
||||
browser.links.find_by_href('/miniflux/feeds').first.click()
|
||||
functional.click_link_by_href(browser, '/miniflux/feeds')
|
||||
|
||||
return browser.is_text_present(feed_name)
|
||||
|
||||
@ -164,6 +164,7 @@ module = [
|
||||
"django.*",
|
||||
"gi.*",
|
||||
"pam.*",
|
||||
"pexpect.*",
|
||||
"pgi.*",
|
||||
"plinth.tests.config_local",
|
||||
"pytest_splinter.*",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user