mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
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:
parent
98cc6c4753
commit
93e9f95d18
@ -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
|
||||
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user