privoxy: Convert functional tests to non-BDD python format

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2021-09-30 11:02:42 -04:00 committed by Sunil Mohan Adapa
parent 98cc6c4753
commit 93e9f95d18
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 31 additions and 28 deletions

View File

@ -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

View File

@ -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')