diff --git a/plinth/modules/privoxy/tests/privoxy.feature b/plinth/modules/privoxy/tests/privoxy.feature deleted file mode 100644 index ff397339d..000000000 --- a/plinth/modules/privoxy/tests/privoxy.feature +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later - -@apps @privoxy -Feature: Privoxy Web Proxy - Proxy web connections for enhanced privacy. - -Background: - Given I'm a logged in user - Given the privoxy application is installed - -Scenario: Enable privoxy application - Given the privoxy application is disabled - When I enable the privoxy application - Then the privoxy service should be running - -@backups -Scenario: Backup and restore privoxy - Given the privoxy application is enabled - When I create a backup of the privoxy app data with name test_privoxy - And I restore the privoxy app data backup with name test_privoxy - Then the privoxy service should be running - -Scenario: Disable privoxy application - Given the privoxy application is enabled - When I disable the privoxy application - Then the privoxy service should not be running diff --git a/plinth/modules/privoxy/tests/test_functional.py b/plinth/modules/privoxy/tests/test_functional.py index 10638de5d..3554532d8 100644 --- a/plinth/modules/privoxy/tests/test_functional.py +++ b/plinth/modules/privoxy/tests/test_functional.py @@ -3,6 +3,35 @@ Functional, browser based tests for privoxy app. """ -from pytest_bdd import scenarios +import pytest +from plinth.tests import functional -scenarios('privoxy.feature') +pytestmark = [pytest.mark.apps, pytest.mark.privoxy] + + +@pytest.fixture(scope='module', autouse=True) +def fixture_background(session_browser): + """Login and install the app.""" + functional.login(session_browser) + functional.install(session_browser, 'privoxy') + yield + functional.app_disable(session_browser, 'privoxy') + + +def test_enable_disable(session_browser): + """Test enabling the app.""" + functional.app_disable(session_browser, 'privoxy') + + functional.app_enable(session_browser, 'privoxy') + assert functional.service_is_running(session_browser, 'privoxy') + + functional.app_disable(session_browser, 'privoxy') + assert functional.service_is_not_running(session_browser, 'privoxy') + + +def test_backup_restore(session_browser): + """Test backup and restore.""" + functional.app_enable(session_browser, 'privoxy') + functional.backup_create(session_browser, 'privoxy', 'test_privoxy') + functional.backup_restore(session_browser, 'privoxy', 'test_privoxy') + assert functional.service_is_running(session_browser, 'privoxy')