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:
James Valleroy 2021-11-03 14:58:04 -04:00 committed by Sunil Mohan Adapa
parent 520feedaca
commit 10ece80a56
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
3 changed files with 4 additions and 6 deletions

View File

@ -14,3 +14,4 @@ class TestI2pApp(BaseAppTests):
app_name = 'i2p'
has_service = True
has_web = True
diagnostics_delay = 1

View File

@ -4,7 +4,6 @@ Functional, browser based tests for matrixsynapse app.
"""
import pytest
import time
from plinth.tests import functional
@ -15,6 +14,7 @@ class TestMatrixSynapseApp(functional.BaseAppTests):
app_name = 'matrixsynapse'
has_service = True
has_web = False
diagnostics_delay = 1
@pytest.fixture(scope='class', autouse=True)
def fixture_setup(self, session_browser):
@ -24,8 +24,3 @@ class TestMatrixSynapseApp(functional.BaseAppTests):
functional.install(session_browser, self.app_name)
functional.app_select_domain_name(session_browser, self.app_name,
'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)

View File

@ -599,6 +599,7 @@ class BaseAppTests:
has_service = False
has_web = True
check_diagnostics = True
diagnostics_delay = 0
def assert_app_running(self, session_browser):
"""Assert that the app is running."""
@ -639,6 +640,7 @@ class BaseAppTests:
if not self.check_diagnostics:
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()
submit(session_browser, form_class='form-diagnostics-button')