mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
tests: functional: Add diagnostics delay parameter
Time to delay after app is enabled, before checking diagnosics. Default value is 0 (no delay). Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
520feedaca
commit
10ece80a56
@ -14,3 +14,4 @@ class TestI2pApp(BaseAppTests):
|
|||||||
app_name = 'i2p'
|
app_name = 'i2p'
|
||||||
has_service = True
|
has_service = True
|
||||||
has_web = True
|
has_web = True
|
||||||
|
diagnostics_delay = 1
|
||||||
|
|||||||
@ -4,7 +4,6 @@ Functional, browser based tests for matrixsynapse app.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import time
|
|
||||||
|
|
||||||
from plinth.tests import functional
|
from plinth.tests import functional
|
||||||
|
|
||||||
@ -15,6 +14,7 @@ class TestMatrixSynapseApp(functional.BaseAppTests):
|
|||||||
app_name = 'matrixsynapse'
|
app_name = 'matrixsynapse'
|
||||||
has_service = True
|
has_service = True
|
||||||
has_web = False
|
has_web = False
|
||||||
|
diagnostics_delay = 1
|
||||||
|
|
||||||
@pytest.fixture(scope='class', autouse=True)
|
@pytest.fixture(scope='class', autouse=True)
|
||||||
def fixture_setup(self, session_browser):
|
def fixture_setup(self, session_browser):
|
||||||
@ -24,8 +24,3 @@ class TestMatrixSynapseApp(functional.BaseAppTests):
|
|||||||
functional.install(session_browser, self.app_name)
|
functional.install(session_browser, self.app_name)
|
||||||
functional.app_select_domain_name(session_browser, self.app_name,
|
functional.app_select_domain_name(session_browser, self.app_name,
|
||||||
'mydomain.example')
|
'mydomain.example')
|
||||||
|
|
||||||
def test_run_diagnostics(self, session_browser):
|
|
||||||
"""Add a short delay before checking diagnostics."""
|
|
||||||
time.sleep(1)
|
|
||||||
super().test_run_diagnostics(session_browser)
|
|
||||||
|
|||||||
@ -599,6 +599,7 @@ class BaseAppTests:
|
|||||||
has_service = False
|
has_service = False
|
||||||
has_web = True
|
has_web = True
|
||||||
check_diagnostics = True
|
check_diagnostics = True
|
||||||
|
diagnostics_delay = 0
|
||||||
|
|
||||||
def assert_app_running(self, session_browser):
|
def assert_app_running(self, session_browser):
|
||||||
"""Assert that the app is running."""
|
"""Assert that the app is running."""
|
||||||
@ -639,6 +640,7 @@ class BaseAppTests:
|
|||||||
if not self.check_diagnostics:
|
if not self.check_diagnostics:
|
||||||
pytest.skip(f'Skipping diagnostics check for ${self.app_name}.')
|
pytest.skip(f'Skipping diagnostics check for ${self.app_name}.')
|
||||||
|
|
||||||
|
time.sleep(self.diagnostics_delay)
|
||||||
session_browser.find_by_id('id_extra_actions_button').click()
|
session_browser.find_by_id('id_extra_actions_button').click()
|
||||||
submit(session_browser, form_class='form-diagnostics-button')
|
submit(session_browser, form_class='form-diagnostics-button')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user