nbenedek 1659b456d1
matrixsynapse: Completely uninstall app
Remove database, mediafiles and freedombox configs.
Removal of certs are not neccessary since the next setup will
overwrite them

Test:
1. Install the app and set a domain
2. Reinstall the app and confirm the domain can be set like it's the first time

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
[sunil: Fix uninstall functional test]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-04-12 14:44:45 +05:30

33 lines
1.1 KiB
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Functional, browser based tests for matrixsynapse app.
"""
import pytest
from plinth.tests import functional
pytestmark = [pytest.mark.apps, pytest.mark.matrixsynapse]
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):
"""Setup the app."""
functional.login(session_browser)
functional.set_domain_name(session_browser, 'mydomain.example')
functional.install(session_browser, self.app_name)
functional.app_select_domain_name(session_browser, self.app_name,
'mydomain.example')
def test_uninstall(self, session_browser):
"""After uninstall test, after installing select the domain again."""
super().test_uninstall(session_browser)
functional.app_select_domain_name(session_browser, self.app_name,
'mydomain.example')