mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
tests: functional: Don't enable/disable app during tests
- Currently, after every test we disable the app and re-enable for the next test. The original purpose of this disabling is to make sure that an app is disabled after test on it. So, change the scope of disabling the app to ensure that it is only disabled once after all the tests on the app. This should improve the run time of the tests. Tests: - Run functional tests on bepasty app. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
fe98e3eb69
commit
63ada3ee62
@ -738,16 +738,21 @@ class BaseAppTests:
|
||||
"""Install the app and set it up if needed."""
|
||||
install(session_browser, self.app_name)
|
||||
|
||||
@pytest.fixture(autouse=True, scope='class', name='disable_after_tests')
|
||||
def fixture_disable_after_tests(self, session_browser):
|
||||
"""Disable the app after running tests."""
|
||||
yield
|
||||
if self.disable_after_tests:
|
||||
app_disable(session_browser, self.app_name)
|
||||
|
||||
@pytest.fixture(autouse=True, name='background')
|
||||
def fixture_background(self, session_browser):
|
||||
def fixture_background(self, session_browser, disable_after_tests):
|
||||
"""Login, install, and enable the app."""
|
||||
login(session_browser)
|
||||
self.install_and_setup(session_browser)
|
||||
app_enable(session_browser, self.app_name)
|
||||
yield
|
||||
login(session_browser)
|
||||
if self.disable_after_tests:
|
||||
app_disable(session_browser, self.app_name)
|
||||
|
||||
def test_enable_disable(self, session_browser):
|
||||
"""Test enabling and disabling the app."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user