From e097250d906e6263645e85e44e5f69d6b91fb7a2 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Tue, 7 Sep 2021 17:20:26 -0400 Subject: [PATCH] jsxc: Convert functional tests to non-BDD python format Signed-off-by: James Valleroy [sunil: Add markers] Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa --- plinth/modules/jsxc/tests/jsxc.feature | 19 --------------- plinth/modules/jsxc/tests/test_functional.py | 25 ++++++++++++++++++-- 2 files changed, 23 insertions(+), 21 deletions(-) delete mode 100644 plinth/modules/jsxc/tests/jsxc.feature diff --git a/plinth/modules/jsxc/tests/jsxc.feature b/plinth/modules/jsxc/tests/jsxc.feature deleted file mode 100644 index f39577bd9..000000000 --- a/plinth/modules/jsxc/tests/jsxc.feature +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later - -@apps @jsxc -Feature: JSXC XMPP Client - Run the JSXC XMPP client. - -Background: - Given I'm a logged in user - -Scenario: Install jsxc application - Given the jsxc application is installed - Then the jsxc site should be available - -@backups -Scenario: Backup and restore jsxc - Given the jsxc application is installed - When I create a backup of the jsxc app data with name test_jsxc - And I restore the jsxc app data backup with name test_jsxc - Then the jsxc site should be available diff --git a/plinth/modules/jsxc/tests/test_functional.py b/plinth/modules/jsxc/tests/test_functional.py index 47f30123e..f482a82c7 100644 --- a/plinth/modules/jsxc/tests/test_functional.py +++ b/plinth/modules/jsxc/tests/test_functional.py @@ -3,6 +3,27 @@ Functional, browser based tests for jsxc app. """ -from pytest_bdd import scenarios +import pytest +from plinth.tests import functional -scenarios('jsxc.feature') +pytestmark = [pytest.mark.apps, pytest.mark.jsxc] + + +@pytest.fixture(scope='module', autouse=True) +def fixture_background(session_browser): + """Login.""" + functional.login(session_browser) + + +def test_install(session_browser): + """Test installing the app.""" + functional.install(session_browser, 'jsxc') + assert functional.is_available(session_browser, 'jsxc') + + +@pytest.mark.backups +def test_backup(session_browser): + """Test backing up and restoring.""" + functional.backup_create(session_browser, 'jsxc', 'test_jsxc') + functional.backup_restore(session_browser, 'jsxc', 'test_jsxc') + assert functional.is_available(session_browser, 'jsxc')