matrixsynapse: Convert functional tests to non-BDD python format

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Add markers]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2021-09-07 11:01:46 -04:00 committed by Sunil Mohan Adapa
parent c2844d358e
commit 9cc69ed32c
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 26 additions and 23 deletions

View File

@ -1,21 +0,0 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
@apps @matrixsynapse
Feature: Matrix Synapse VoIP and Chat Server
Run Matrix Synapse server
Background:
Given I'm a logged in user
Given the domain name is set to mydomain.example
Given the matrixsynapse application is installed
Given the domain name for matrixsynapse is set to mydomain.example
Scenario: Enable matrixsynapse application
Given the matrixsynapse application is disabled
When I enable the matrixsynapse application
Then the matrixsynapse service should be running
Scenario: Disable matrixsynapse application
Given the matrixsynapse application is enabled
When I disable the matrixsynapse application
Then the matrixsynapse service should not be running

View File

@ -3,6 +3,30 @@
Functional, browser based tests for matrixsynapse app.
"""
from pytest_bdd import scenarios
import pytest
from plinth.tests import functional
scenarios('matrixsynapse.feature')
pytestmark = [pytest.mark.apps, pytest.mark.matrixsynapse]
@pytest.fixture(scope='module', autouse=True)
def fixture_background(session_browser):
"""Login and install the app."""
functional.login(session_browser)
functional.set_domain_name(session_browser, 'mydomain.example')
functional.install(session_browser, 'matrixsynapse')
functional.app_select_domain_name(session_browser, 'matrixsynapse',
'mydomain.example')
yield
functional.app_disable(session_browser, 'matrixsynapse')
def test_enable_disable(session_browser):
"""Test enabling the app."""
functional.app_disable(session_browser, 'matrixsynapse')
functional.app_enable(session_browser, 'matrixsynapse')
assert functional.service_is_running(session_browser, 'matrixsynapse')
functional.app_disable(session_browser, 'matrixsynapse')
assert functional.service_is_not_running(session_browser, 'matrixsynapse')