tests: functional: Refactor install/setup fixture for apps

- Fixes an issue with zoph not being setup after uninstall+install setup and
makes a test pass.

- Some failures exist but don't seem related to this change.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2024-03-11 16:50:56 -04:00
1 parent 8096c14b14
commit 5dbf890881
7 files changed
+27 -31

No files matched your search

@@ -21,7 +21,10 @@ class TestMatrixSynapseApp(functional.BaseAppTests):
"""Setup the app."""
functional.login(session_browser)
functional.set_domain_name(session_browser, 'mydomain.example')
functional.install(session_browser, self.app_name)
def install_and_setup(self, session_browser):
"""Install the app and run setup."""
super().install_and_setup(session_browser)
functional.app_select_domain_name(session_browser, self.app_name,
'mydomain.example')
@@ -20,12 +20,9 @@ class TestMediawikiApp(functional.BaseAppTests):
has_service = False
has_web = True
@pytest.fixture(scope='class', autouse=True)
def fixture_setup(self, session_browser):
"""Setup the app."""
functional.login(session_browser)
functional.install(session_browser, 'mediawiki')
functional.app_enable(session_browser, 'mediawiki')
def install_and_setup(self, session_browser):
"""Install the app and run setup."""
super().install_and_setup(session_browser)
_set_domain(session_browser)
_set_admin_password(session_browser, 'whatever123')
@@ -17,12 +17,9 @@ class TestShaarliApp(functional.BaseAppTests):
has_service = False
has_web = True
@pytest.fixture(scope='class', autouse=True)
def fixture_setup(self, session_browser):
"""Setup the app."""
functional.login(session_browser)
functional.install(session_browser, self.app_name)
functional.app_enable(session_browser, self.app_name)
def install_and_setup(self, session_browser):
"""Install the app and set it up if needed."""
super().install_and_setup(session_browser)
self._shaarli_is_setup(session_browser)
def _shaarli_is_setup(self, session_browser):
@@ -15,11 +15,9 @@ class TestShadowsocksApp(functional.BaseAppTests):
has_service = True
has_web = False
@pytest.fixture(scope='class', autouse=True)
def fixture_setup(self, session_browser):
"""Setup the app."""
functional.login(session_browser)
functional.install(session_browser, 'shadowsocks')
def install_and_setup(self, session_browser):
"""Install the app and run setup."""
super().install_and_setup(session_browser)
_configure(session_browser, 'example.com', 'fakepassword')
@pytest.mark.backups
@@ -15,11 +15,9 @@ class TestShadowsocksServerApp(functional.BaseAppTests):
has_service = True
has_web = False
@pytest.fixture(scope='class', autouse=True)
def fixture_setup(self, session_browser):
"""Setup the app."""
functional.login(session_browser)
functional.install(session_browser, 'shadowsocksserver')
def install_and_setup(self, session_browser):
"""Install the app and run setup."""
super().install_and_setup(session_browser)
_configure(session_browser, 'fakepassword')
@pytest.mark.backups
+5 -6
View File
@@ -15,17 +15,16 @@ class TestZophApp(functional.BaseAppTests):
has_service = False
has_web = True
@pytest.fixture(scope='class', autouse=True)
def fixture_setup(self, session_browser):
"""Setup the app."""
functional.login(session_browser)
functional.install(session_browser, self.app_name)
def install_and_setup(self, session_browser):
"""Install the app and run setup."""
super().install_and_setup(session_browser)
self._zoph_is_setup(session_browser)
def _zoph_is_setup(self, session_browser):
"""Click setup button on the setup page."""
functional.nav_to_module(session_browser, self.app_name)
functional.submit(session_browser, form_class='form-configuration')
if session_browser.find_by_css('.form-configuration'):
functional.submit(session_browser, form_class='form-configuration')
def assert_app_running(self, session_browser):
assert functional.app_is_enabled(session_browser, self.app_name)