From 80d67c20545ed950bbfc872cdbdae13abd94d82a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 19 May 2020 13:11:23 -0700 Subject: [PATCH] tests: functional: Merge into main source hierarchy - Add pytest hooks to ignore all functional tests if pytest_bdd is not installed. - Update pytest hooks to skip tests in file named 'test_functional.py' if --include-functional argument is not provided. - Move functional_tests/install.py into plinth/tests/functional and update reference in Vagrantfile. - Move scenario files into individual app folders. Rename them after the app they are testing. Merge TODO items listed in todo.org into corresponding feature files. - Add test_functional.py in each app to build tests from the features file using pytest_bdd. - Move all step_definitions, support and data into plinth/tests/functional/. Include all step_definitions from conftest.py. Update to relative imports instead of absolute imports. Tests performed: - Run py.test-3 --collect-only shows all functional tests and lists 574 tests. No errors show that name of feature files are correct. The number says that all functional test features are included. - Remove pytest_bdd (or modify the import name) and run py.test-3 --collect-only skips collecting all functional tests and shows only 300+ tests. - Run functional tests for a few apps with py.test-3 --include-functional -m app. For storage, deluge. - Run unit tests with py.test-3. Functional tests are listed by skipped. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Joseph Nuthalapati --- Vagrantfile | 2 +- conftest.py | 25 ++++++++++++- functional_tests/test_plinth.py | 19 ---------- functional_tests/todo.org | 35 ------------------ .../modules/avahi/tests/avahi.feature | 0 plinth/modules/avahi/tests/test_functional.py | 8 ++++ .../modules/backups/tests}/backups.feature | 0 .../modules/backups/tests/test_functional.py | 8 ++++ .../modules/bind/tests}/bind.feature | 0 plinth/modules/bind/tests/test_functional.py | 8 ++++ .../modules/cockpit/tests/cockpit.feature | 0 .../modules/cockpit/tests/test_functional.py | 8 ++++ .../modules/config/tests/config.feature | 0 .../modules/config/tests/test_functional.py | 8 ++++ .../modules/coquelicot/tests}/__init__.py | 0 .../coquelicot/tests}/coquelicot.feature | 0 .../coquelicot/tests/test_functional.py | 8 ++++ .../modules/coturn/tests}/coturn.feature | 0 .../modules/coturn/tests/test_functional.py | 8 ++++ .../modules/datetime/tests/datetime.feature | 0 .../modules/datetime/tests/test_functional.py | 8 ++++ .../modules/deluge/tests}/deluge.feature | 0 .../modules/deluge/tests/test_functional.py | 8 ++++ .../dynamicdns/tests}/dynamicdns.feature | 6 +++ .../dynamicdns/tests/test_functional.py | 8 ++++ .../modules/ejabberd/tests}/ejabberd.feature | 3 ++ .../modules/ejabberd/tests/test_functional.py | 8 ++++ .../modules/gitweb/tests}/gitweb.feature | 0 .../modules/gitweb/tests/test_functional.py | 8 ++++ .../modules/help/tests}/help.feature | 6 +++ plinth/modules/help/tests/test_functional.py | 8 ++++ .../modules/i2p/tests}/i2p.feature | 0 plinth/modules/i2p/tests/test_functional.py | 8 ++++ .../modules/ikiwiki/tests}/ikiwiki.feature | 0 .../modules/ikiwiki/tests/test_functional.py | 8 ++++ .../infinoted/tests}/infinoted.feature | 0 .../infinoted/tests/test_functional.py | 8 ++++ .../modules/jsxc/tests}/jsxc.feature | 0 plinth/modules/jsxc/tests/test_functional.py | 8 ++++ .../tests}/matrixsynapse.feature | 0 .../matrixsynapse/tests/test_functional.py | 8 ++++ plinth/modules/mediawiki/tests/__init__.py | 0 .../mediawiki/tests}/mediawiki.feature | 0 .../mediawiki/tests/test_functional.py | 8 ++++ .../modules/minetest/tests}/minetest.feature | 0 .../modules/minetest/tests/test_functional.py | 8 ++++ .../modules/minidlna/tests}/minidlna.feature | 0 .../modules/minidlna/tests/test_functional.py | 8 ++++ plinth/modules/mldonkey/tests/__init__.py | 0 .../modules/mldonkey/tests}/mldonkey.feature | 0 .../modules/mldonkey/tests/test_functional.py | 8 ++++ .../monkeysphere/tests}/monkeysphere.feature | 0 .../monkeysphere/tests/test_functional.py | 8 ++++ .../modules/mumble/tests}/mumble.feature | 0 .../modules/mumble/tests/test_functional.py | 8 ++++ .../modules/openvpn/tests}/openvpn.feature | 0 .../modules/openvpn/tests/test_functional.py | 8 ++++ .../modules/pagekite/tests}/pagekite.feature | 5 +++ .../modules/pagekite/tests/test_functional.py | 8 ++++ .../performance/tests}/performance.feature | 0 .../performance/tests/test_functional.py | 8 ++++ .../modules/privoxy/tests}/privoxy.feature | 0 .../modules/privoxy/tests/test_functional.py | 8 ++++ .../modules/quassel/tests}/quassel.feature | 0 .../modules/quassel/tests/test_functional.py | 8 ++++ .../modules/radicale/tests}/radicale.feature | 0 .../modules/radicale/tests/test_functional.py | 8 ++++ .../roundcube/tests}/roundcube.feature | 0 .../roundcube/tests/test_functional.py | 8 ++++ .../modules/samba/tests}/samba.feature | 0 plinth/modules/samba/tests/test_functional.py | 8 ++++ plinth/modules/searx/tests/__init__.py | 0 .../modules/searx/tests}/searx.feature | 0 plinth/modules/searx/tests/test_functional.py | 8 ++++ .../modules/security/tests}/security.feature | 0 .../modules/security/tests/test_functional.py | 8 ++++ .../shadowsocks/tests}/shadowsocks.feature | 0 .../shadowsocks/tests/test_functional.py | 8 ++++ plinth/modules/sharing/tests/__init__.py | 0 .../modules/sharing/tests}/sharing.feature | 0 .../modules/sharing/tests/test_functional.py | 8 ++++ .../modules/snapshot/tests/snapshot.feature | 0 .../modules/snapshot/tests/test_functional.py | 8 ++++ .../modules/ssh/tests}/ssh.feature | 0 plinth/modules/ssh/tests/test_functional.py | 8 ++++ plinth/modules/sso/tests/__init__.py | 0 .../modules/sso/tests/sso.feature | 0 plinth/modules/sso/tests/test_functional.py | 8 ++++ .../modules/storage/tests}/storage.feature | 0 .../modules/storage/tests/test_functional.py | 8 ++++ plinth/modules/syncthing/tests/__init__.py | 0 .../syncthing/tests}/syncthing.feature | 0 .../syncthing/tests/test_functional.py | 8 ++++ plinth/modules/tahoe/tests/__init__.py | 0 .../modules/tahoe/tests}/tahoe.feature | 0 plinth/modules/tahoe/tests/test_functional.py | 8 ++++ plinth/modules/tor/tests/test_functional.py | 8 ++++ .../modules/tor/tests}/tor.feature | 0 .../transmission/tests/test_functional.py | 8 ++++ .../transmission/tests}/transmission.feature | 0 plinth/modules/ttrss/tests/test_functional.py | 8 ++++ .../modules/ttrss/tests}/ttrss.feature | 0 .../modules/upgrades/tests/test_functional.py | 8 ++++ .../modules/upgrades/tests}/upgrades.feature | 0 plinth/modules/users/tests/test_functional.py | 8 ++++ .../modules/users/tests/users.feature | 8 ++++ plinth/tests/functional/__init__.py | 0 .../tests/functional}/config.ini | 0 .../tests/functional}/data/sample.torrent | Bin .../tests/functional}/install.sh | 0 .../functional/step_definitions/__init__.py | 0 .../step_definitions/application.py | 2 +- .../functional}/step_definitions/interface.py | 2 +- .../functional}/step_definitions/service.py | 4 +- .../functional}/step_definitions/site.py | 2 +- .../functional}/step_definitions/system.py | 2 +- .../tests/functional}/support/__init__.py | 0 .../tests/functional}/support/application.py | 6 +-- .../tests/functional}/support/interface.py | 3 +- .../tests/functional}/support/service.py | 5 ++- .../tests/functional}/support/site.py | 4 +- .../tests/functional}/support/system.py | 2 +- 122 files changed, 444 insertions(+), 73 deletions(-) delete mode 100644 functional_tests/test_plinth.py delete mode 100644 functional_tests/todo.org rename functional_tests/features/service_discovery.feature => plinth/modules/avahi/tests/avahi.feature (100%) create mode 100644 plinth/modules/avahi/tests/test_functional.py rename {functional_tests/features => plinth/modules/backups/tests}/backups.feature (100%) create mode 100644 plinth/modules/backups/tests/test_functional.py rename {functional_tests/features => plinth/modules/bind/tests}/bind.feature (100%) create mode 100644 plinth/modules/bind/tests/test_functional.py rename functional_tests/features/server_administration.feature => plinth/modules/cockpit/tests/cockpit.feature (100%) create mode 100644 plinth/modules/cockpit/tests/test_functional.py rename functional_tests/features/configuration.feature => plinth/modules/config/tests/config.feature (100%) create mode 100644 plinth/modules/config/tests/test_functional.py rename {functional_tests/step_definitions => plinth/modules/coquelicot/tests}/__init__.py (100%) rename {functional_tests/features => plinth/modules/coquelicot/tests}/coquelicot.feature (100%) create mode 100644 plinth/modules/coquelicot/tests/test_functional.py rename {functional_tests/features => plinth/modules/coturn/tests}/coturn.feature (100%) create mode 100644 plinth/modules/coturn/tests/test_functional.py rename functional_tests/features/date_and_time.feature => plinth/modules/datetime/tests/datetime.feature (100%) create mode 100644 plinth/modules/datetime/tests/test_functional.py rename {functional_tests/features => plinth/modules/deluge/tests}/deluge.feature (100%) create mode 100644 plinth/modules/deluge/tests/test_functional.py rename {functional_tests/features => plinth/modules/dynamicdns/tests}/dynamicdns.feature (69%) create mode 100644 plinth/modules/dynamicdns/tests/test_functional.py rename {functional_tests/features => plinth/modules/ejabberd/tests}/ejabberd.feature (95%) create mode 100644 plinth/modules/ejabberd/tests/test_functional.py rename {functional_tests/features => plinth/modules/gitweb/tests}/gitweb.feature (100%) create mode 100644 plinth/modules/gitweb/tests/test_functional.py rename {functional_tests/features => plinth/modules/help/tests}/help.feature (60%) create mode 100644 plinth/modules/help/tests/test_functional.py rename {functional_tests/features => plinth/modules/i2p/tests}/i2p.feature (100%) create mode 100644 plinth/modules/i2p/tests/test_functional.py rename {functional_tests/features => plinth/modules/ikiwiki/tests}/ikiwiki.feature (100%) create mode 100644 plinth/modules/ikiwiki/tests/test_functional.py rename {functional_tests/features => plinth/modules/infinoted/tests}/infinoted.feature (100%) create mode 100644 plinth/modules/infinoted/tests/test_functional.py rename {functional_tests/features => plinth/modules/jsxc/tests}/jsxc.feature (100%) create mode 100644 plinth/modules/jsxc/tests/test_functional.py rename {functional_tests/features => plinth/modules/matrixsynapse/tests}/matrixsynapse.feature (100%) create mode 100644 plinth/modules/matrixsynapse/tests/test_functional.py create mode 100644 plinth/modules/mediawiki/tests/__init__.py rename {functional_tests/features => plinth/modules/mediawiki/tests}/mediawiki.feature (100%) create mode 100644 plinth/modules/mediawiki/tests/test_functional.py rename {functional_tests/features => plinth/modules/minetest/tests}/minetest.feature (100%) create mode 100644 plinth/modules/minetest/tests/test_functional.py rename {functional_tests/features => plinth/modules/minidlna/tests}/minidlna.feature (100%) create mode 100644 plinth/modules/minidlna/tests/test_functional.py create mode 100644 plinth/modules/mldonkey/tests/__init__.py rename {functional_tests/features => plinth/modules/mldonkey/tests}/mldonkey.feature (100%) create mode 100644 plinth/modules/mldonkey/tests/test_functional.py rename {functional_tests/features => plinth/modules/monkeysphere/tests}/monkeysphere.feature (100%) create mode 100644 plinth/modules/monkeysphere/tests/test_functional.py rename {functional_tests/features => plinth/modules/mumble/tests}/mumble.feature (100%) create mode 100644 plinth/modules/mumble/tests/test_functional.py rename {functional_tests/features => plinth/modules/openvpn/tests}/openvpn.feature (100%) create mode 100644 plinth/modules/openvpn/tests/test_functional.py rename {functional_tests/features => plinth/modules/pagekite/tests}/pagekite.feature (91%) create mode 100644 plinth/modules/pagekite/tests/test_functional.py rename {functional_tests/features => plinth/modules/performance/tests}/performance.feature (100%) create mode 100644 plinth/modules/performance/tests/test_functional.py rename {functional_tests/features => plinth/modules/privoxy/tests}/privoxy.feature (100%) create mode 100644 plinth/modules/privoxy/tests/test_functional.py rename {functional_tests/features => plinth/modules/quassel/tests}/quassel.feature (100%) create mode 100644 plinth/modules/quassel/tests/test_functional.py rename {functional_tests/features => plinth/modules/radicale/tests}/radicale.feature (100%) create mode 100644 plinth/modules/radicale/tests/test_functional.py rename {functional_tests/features => plinth/modules/roundcube/tests}/roundcube.feature (100%) create mode 100644 plinth/modules/roundcube/tests/test_functional.py rename {functional_tests/features => plinth/modules/samba/tests}/samba.feature (100%) create mode 100644 plinth/modules/samba/tests/test_functional.py create mode 100644 plinth/modules/searx/tests/__init__.py rename {functional_tests/features => plinth/modules/searx/tests}/searx.feature (100%) create mode 100644 plinth/modules/searx/tests/test_functional.py rename {functional_tests/features => plinth/modules/security/tests}/security.feature (100%) create mode 100644 plinth/modules/security/tests/test_functional.py rename {functional_tests/features => plinth/modules/shadowsocks/tests}/shadowsocks.feature (100%) create mode 100644 plinth/modules/shadowsocks/tests/test_functional.py create mode 100644 plinth/modules/sharing/tests/__init__.py rename {functional_tests/features => plinth/modules/sharing/tests}/sharing.feature (100%) create mode 100644 plinth/modules/sharing/tests/test_functional.py rename functional_tests/features/storage_snapshots.feature => plinth/modules/snapshot/tests/snapshot.feature (100%) create mode 100644 plinth/modules/snapshot/tests/test_functional.py rename {functional_tests/features => plinth/modules/ssh/tests}/ssh.feature (100%) create mode 100644 plinth/modules/ssh/tests/test_functional.py create mode 100644 plinth/modules/sso/tests/__init__.py rename functional_tests/features/single_sign_on.feature => plinth/modules/sso/tests/sso.feature (100%) create mode 100644 plinth/modules/sso/tests/test_functional.py rename {functional_tests/features => plinth/modules/storage/tests}/storage.feature (100%) create mode 100644 plinth/modules/storage/tests/test_functional.py create mode 100644 plinth/modules/syncthing/tests/__init__.py rename {functional_tests/features => plinth/modules/syncthing/tests}/syncthing.feature (100%) create mode 100644 plinth/modules/syncthing/tests/test_functional.py create mode 100644 plinth/modules/tahoe/tests/__init__.py rename {functional_tests/features => plinth/modules/tahoe/tests}/tahoe.feature (100%) create mode 100644 plinth/modules/tahoe/tests/test_functional.py create mode 100644 plinth/modules/tor/tests/test_functional.py rename {functional_tests/features => plinth/modules/tor/tests}/tor.feature (100%) create mode 100644 plinth/modules/transmission/tests/test_functional.py rename {functional_tests/features => plinth/modules/transmission/tests}/transmission.feature (100%) create mode 100644 plinth/modules/ttrss/tests/test_functional.py rename {functional_tests/features => plinth/modules/ttrss/tests}/ttrss.feature (100%) create mode 100644 plinth/modules/upgrades/tests/test_functional.py rename {functional_tests/features => plinth/modules/upgrades/tests}/upgrades.feature (100%) create mode 100644 plinth/modules/users/tests/test_functional.py rename functional_tests/features/users_and_groups.feature => plinth/modules/users/tests/users.feature (81%) create mode 100644 plinth/tests/functional/__init__.py rename {functional_tests => plinth/tests/functional}/config.ini (100%) rename {functional_tests => plinth/tests/functional}/data/sample.torrent (100%) rename {functional_tests => plinth/tests/functional}/install.sh (100%) create mode 100644 plinth/tests/functional/step_definitions/__init__.py rename {functional_tests => plinth/tests/functional}/step_definitions/application.py (99%) rename {functional_tests => plinth/tests/functional}/step_definitions/interface.py (98%) rename {functional_tests => plinth/tests/functional}/step_definitions/service.py (94%) rename {functional_tests => plinth/tests/functional}/step_definitions/site.py (99%) rename {functional_tests => plinth/tests/functional}/step_definitions/system.py (99%) rename {functional_tests => plinth/tests/functional}/support/__init__.py (100%) rename {functional_tests => plinth/tests/functional}/support/application.py (99%) rename {functional_tests => plinth/tests/functional}/support/interface.py (99%) rename {functional_tests => plinth/tests/functional}/support/service.py (98%) rename {functional_tests => plinth/tests/functional}/support/site.py (99%) rename {functional_tests => plinth/tests/functional}/support/system.py (99%) diff --git a/Vagrantfile b/Vagrantfile index c4d60e8aa..bda895ea4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -38,7 +38,7 @@ Vagrant.configure(2) do |config| DEBIAN_FRONTEND=noninteractive apt-get install -y ncurses-term echo 'alias run-develop="sudo -u plinth /vagrant/run --develop"' >> /home/vagrant/.bashrc SHELL - config.vm.provision "tests", run: "never", type: "shell", path: "functional_tests/install.sh" + config.vm.provision "tests", run: "never", type: "shell", path: "plinth/tests/functional/install.sh" config.vm.post_up_message = "FreedomBox virtual machine is ready for development. You can run the development version of Plinth using the following command. diff --git a/conftest.py b/conftest.py index 5066e23c5..c70aa0843 100644 --- a/conftest.py +++ b/conftest.py @@ -3,11 +3,30 @@ pytest configuration for all tests. """ +import importlib import os import pathlib import pytest +try: + importlib.import_module('pytest_bdd') + _bdd_available = True +except ImportError: + _bdd_available = False +else: + from plinth.tests.functional.step_definitions.application import * + from plinth.tests.functional.step_definitions.interface import * + from plinth.tests.functional.step_definitions.service import * + from plinth.tests.functional.step_definitions.site import * + from plinth.tests.functional.step_definitions.system import * + + +def pytest_ignore_collect(path, config): + """Return True to ignore functional tests.""" + if path.basename == 'test_functional.py': + return not _bdd_available + def pytest_addoption(parser): """Add a command line option to run functional tests.""" @@ -16,7 +35,7 @@ def pytest_addoption(parser): def pytest_collection_modifyitems(config, items): - """Filter out functional tests unless --include-functional arg is passed.""" + """Filter out functional tests unless --include-functional is passed.""" if config.getoption('--include-functional'): # Option provided on command line, no filtering return @@ -24,7 +43,9 @@ def pytest_collection_modifyitems(config, items): skip_functional = pytest.mark.skip( reason='--include-functional not provided') for item in items: - if 'functional' in item.keywords: + if 'functional' in item.keywords or ( + item.parent.fspath.basename + and item.parent.fspath.basename == 'test_functional.py'): item.add_marker(skip_functional) diff --git a/functional_tests/test_plinth.py b/functional_tests/test_plinth.py deleted file mode 100644 index 8a61c371e..000000000 --- a/functional_tests/test_plinth.py +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later - -import pytest - -try: - from pytest_bdd import scenarios -except ImportError: - pytestmark = pytest.mark.skip(reason='pytest_bdd is not installed') -else: - from step_definitions.application import * - from step_definitions.interface import * - from step_definitions.service import * - from step_definitions.site import * - from step_definitions.system import * - - # Mark all tests are functional - pytestmark = pytest.mark.functional - - scenarios('features') diff --git a/functional_tests/todo.org b/functional_tests/todo.org deleted file mode 100644 index 07bd58c5b..000000000 --- a/functional_tests/todo.org +++ /dev/null @@ -1,35 +0,0 @@ -* Feature: Users and Groups -** TODO Scenario: Add user to wiki group -** TODO Scenario: Remove user from wiki group -** TODO Scenario: Set user SSH key -** TODO Scenario: Clear user SSH key -** TODO Scenario: Make user inactive -** TODO Scenario: Make user active -** TODO Scenario: Change user password - -* Feature: Help -** TODO Scenario: Visit the wiki -** TODO Scenario: Visit the mailing list -** TODO Scenario: Visit the IRC channel -** TODO Scenario: View the manual -** TODO Scenario: View the about page - -* Feature: Bookmarks -** TODO Enable/Disable - -* Feature: Chat Server -** TODO Check service -** TODO Check domain name display - -* Feature: Dynamic DNS Client -** TODO Scenario: Configure GnuDIP service -** TODO Scenario: Configure noip.com service -** TODO Scenario: Configure selfhost.bz service -** TODO Scenario: Configure freedns.afraid.org service -** TODO Scenario: Configure other update URL service - -* Feature: Public Visibility -** TODO Scenario: Enable standard services -** TODO Scenario: Disable standard services -** TODO Scenario: Add custom service -** TODO Scenario: Delete custom service diff --git a/functional_tests/features/service_discovery.feature b/plinth/modules/avahi/tests/avahi.feature similarity index 100% rename from functional_tests/features/service_discovery.feature rename to plinth/modules/avahi/tests/avahi.feature diff --git a/plinth/modules/avahi/tests/test_functional.py b/plinth/modules/avahi/tests/test_functional.py new file mode 100644 index 000000000..687c73c4f --- /dev/null +++ b/plinth/modules/avahi/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for avahi app. +""" + +from pytest_bdd import scenarios + +scenarios('avahi.feature') diff --git a/functional_tests/features/backups.feature b/plinth/modules/backups/tests/backups.feature similarity index 100% rename from functional_tests/features/backups.feature rename to plinth/modules/backups/tests/backups.feature diff --git a/plinth/modules/backups/tests/test_functional.py b/plinth/modules/backups/tests/test_functional.py new file mode 100644 index 000000000..4c6a3171f --- /dev/null +++ b/plinth/modules/backups/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for backups app. +""" + +from pytest_bdd import scenarios + +scenarios('backups.feature') diff --git a/functional_tests/features/bind.feature b/plinth/modules/bind/tests/bind.feature similarity index 100% rename from functional_tests/features/bind.feature rename to plinth/modules/bind/tests/bind.feature diff --git a/plinth/modules/bind/tests/test_functional.py b/plinth/modules/bind/tests/test_functional.py new file mode 100644 index 000000000..4c5e69b5b --- /dev/null +++ b/plinth/modules/bind/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for bind app. +""" + +from pytest_bdd import scenarios + +scenarios('bind.feature') diff --git a/functional_tests/features/server_administration.feature b/plinth/modules/cockpit/tests/cockpit.feature similarity index 100% rename from functional_tests/features/server_administration.feature rename to plinth/modules/cockpit/tests/cockpit.feature diff --git a/plinth/modules/cockpit/tests/test_functional.py b/plinth/modules/cockpit/tests/test_functional.py new file mode 100644 index 000000000..df5a79a27 --- /dev/null +++ b/plinth/modules/cockpit/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for cockpit app. +""" + +from pytest_bdd import scenarios + +scenarios('cockpit.feature') diff --git a/functional_tests/features/configuration.feature b/plinth/modules/config/tests/config.feature similarity index 100% rename from functional_tests/features/configuration.feature rename to plinth/modules/config/tests/config.feature diff --git a/plinth/modules/config/tests/test_functional.py b/plinth/modules/config/tests/test_functional.py new file mode 100644 index 000000000..84479a4f2 --- /dev/null +++ b/plinth/modules/config/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for config app. +""" + +from pytest_bdd import scenarios + +scenarios('config.feature') diff --git a/functional_tests/step_definitions/__init__.py b/plinth/modules/coquelicot/tests/__init__.py similarity index 100% rename from functional_tests/step_definitions/__init__.py rename to plinth/modules/coquelicot/tests/__init__.py diff --git a/functional_tests/features/coquelicot.feature b/plinth/modules/coquelicot/tests/coquelicot.feature similarity index 100% rename from functional_tests/features/coquelicot.feature rename to plinth/modules/coquelicot/tests/coquelicot.feature diff --git a/plinth/modules/coquelicot/tests/test_functional.py b/plinth/modules/coquelicot/tests/test_functional.py new file mode 100644 index 000000000..b9eb4da65 --- /dev/null +++ b/plinth/modules/coquelicot/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for coquelicot app. +""" + +from pytest_bdd import scenarios + +scenarios('coquelicot.feature') diff --git a/functional_tests/features/coturn.feature b/plinth/modules/coturn/tests/coturn.feature similarity index 100% rename from functional_tests/features/coturn.feature rename to plinth/modules/coturn/tests/coturn.feature diff --git a/plinth/modules/coturn/tests/test_functional.py b/plinth/modules/coturn/tests/test_functional.py new file mode 100644 index 000000000..ae67c7946 --- /dev/null +++ b/plinth/modules/coturn/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for coturn app. +""" + +from pytest_bdd import scenarios + +scenarios('coturn.feature') diff --git a/functional_tests/features/date_and_time.feature b/plinth/modules/datetime/tests/datetime.feature similarity index 100% rename from functional_tests/features/date_and_time.feature rename to plinth/modules/datetime/tests/datetime.feature diff --git a/plinth/modules/datetime/tests/test_functional.py b/plinth/modules/datetime/tests/test_functional.py new file mode 100644 index 000000000..de8e87c77 --- /dev/null +++ b/plinth/modules/datetime/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for datetime app. +""" + +from pytest_bdd import scenarios + +scenarios('datetime.feature') diff --git a/functional_tests/features/deluge.feature b/plinth/modules/deluge/tests/deluge.feature similarity index 100% rename from functional_tests/features/deluge.feature rename to plinth/modules/deluge/tests/deluge.feature diff --git a/plinth/modules/deluge/tests/test_functional.py b/plinth/modules/deluge/tests/test_functional.py new file mode 100644 index 000000000..11f4c84e8 --- /dev/null +++ b/plinth/modules/deluge/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for deluge app. +""" + +from pytest_bdd import scenarios + +scenarios('deluge.feature') diff --git a/functional_tests/features/dynamicdns.feature b/plinth/modules/dynamicdns/tests/dynamicdns.feature similarity index 69% rename from functional_tests/features/dynamicdns.feature rename to plinth/modules/dynamicdns/tests/dynamicdns.feature index 011cdbdc6..e1c281aa4 100644 --- a/functional_tests/features/dynamicdns.feature +++ b/plinth/modules/dynamicdns/tests/dynamicdns.feature @@ -1,5 +1,11 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# TODO Scenario: Configure GnuDIP service +# TODO Scenario: Configure noip.com service +# TODO Scenario: Configure selfhost.bz service +# TODO Scenario: Configure freedns.afraid.org service +# TODO Scenario: Configure other update URL service + @apps @dynamicdns Feature: Dynamic DNS Client Update public IP to a GnuDIP server. diff --git a/plinth/modules/dynamicdns/tests/test_functional.py b/plinth/modules/dynamicdns/tests/test_functional.py new file mode 100644 index 000000000..5438d0c4e --- /dev/null +++ b/plinth/modules/dynamicdns/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for dynamicdns app. +""" + +from pytest_bdd import scenarios + +scenarios('dynamicdns.feature') diff --git a/functional_tests/features/ejabberd.feature b/plinth/modules/ejabberd/tests/ejabberd.feature similarity index 95% rename from functional_tests/features/ejabberd.feature rename to plinth/modules/ejabberd/tests/ejabberd.feature index 774e768cc..444333831 100644 --- a/functional_tests/features/ejabberd.feature +++ b/plinth/modules/ejabberd/tests/ejabberd.feature @@ -1,5 +1,8 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# TODO Check service +# TODO Check domain name display + @apps @ejabberd Feature: Ejabberd Chat Server Run ejabberd chat server. diff --git a/plinth/modules/ejabberd/tests/test_functional.py b/plinth/modules/ejabberd/tests/test_functional.py new file mode 100644 index 000000000..5564dd8b7 --- /dev/null +++ b/plinth/modules/ejabberd/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for ejabberd app. +""" + +from pytest_bdd import scenarios + +scenarios('ejabberd.feature') diff --git a/functional_tests/features/gitweb.feature b/plinth/modules/gitweb/tests/gitweb.feature similarity index 100% rename from functional_tests/features/gitweb.feature rename to plinth/modules/gitweb/tests/gitweb.feature diff --git a/plinth/modules/gitweb/tests/test_functional.py b/plinth/modules/gitweb/tests/test_functional.py new file mode 100644 index 000000000..df1f610c9 --- /dev/null +++ b/plinth/modules/gitweb/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for gitweb app. +""" + +from pytest_bdd import scenarios + +scenarios('gitweb.feature') diff --git a/functional_tests/features/help.feature b/plinth/modules/help/tests/help.feature similarity index 60% rename from functional_tests/features/help.feature rename to plinth/modules/help/tests/help.feature index 4e67c0a6c..39d3955ca 100644 --- a/functional_tests/features/help.feature +++ b/plinth/modules/help/tests/help.feature @@ -1,5 +1,11 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# TODO Scenario: Visit the wiki +# TODO Scenario: Visit the mailing list +# TODO Scenario: Visit the IRC channel +# TODO Scenario: View the manual +# TODO Scenario: View the about page + @help @system @essential Feature: Help module Show various information about the system. diff --git a/plinth/modules/help/tests/test_functional.py b/plinth/modules/help/tests/test_functional.py new file mode 100644 index 000000000..e62284ce8 --- /dev/null +++ b/plinth/modules/help/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for help app. +""" + +from pytest_bdd import scenarios + +scenarios('help.feature') diff --git a/functional_tests/features/i2p.feature b/plinth/modules/i2p/tests/i2p.feature similarity index 100% rename from functional_tests/features/i2p.feature rename to plinth/modules/i2p/tests/i2p.feature diff --git a/plinth/modules/i2p/tests/test_functional.py b/plinth/modules/i2p/tests/test_functional.py new file mode 100644 index 000000000..20926e817 --- /dev/null +++ b/plinth/modules/i2p/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for i2p app. +""" + +from pytest_bdd import scenarios + +scenarios('i2p.feature') diff --git a/functional_tests/features/ikiwiki.feature b/plinth/modules/ikiwiki/tests/ikiwiki.feature similarity index 100% rename from functional_tests/features/ikiwiki.feature rename to plinth/modules/ikiwiki/tests/ikiwiki.feature diff --git a/plinth/modules/ikiwiki/tests/test_functional.py b/plinth/modules/ikiwiki/tests/test_functional.py new file mode 100644 index 000000000..c8a67665f --- /dev/null +++ b/plinth/modules/ikiwiki/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for ikiwiki app. +""" + +from pytest_bdd import scenarios + +scenarios('ikiwiki.feature') diff --git a/functional_tests/features/infinoted.feature b/plinth/modules/infinoted/tests/infinoted.feature similarity index 100% rename from functional_tests/features/infinoted.feature rename to plinth/modules/infinoted/tests/infinoted.feature diff --git a/plinth/modules/infinoted/tests/test_functional.py b/plinth/modules/infinoted/tests/test_functional.py new file mode 100644 index 000000000..be32e536e --- /dev/null +++ b/plinth/modules/infinoted/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for infinoted app. +""" + +from pytest_bdd import scenarios + +scenarios('infinoted.feature') diff --git a/functional_tests/features/jsxc.feature b/plinth/modules/jsxc/tests/jsxc.feature similarity index 100% rename from functional_tests/features/jsxc.feature rename to plinth/modules/jsxc/tests/jsxc.feature diff --git a/plinth/modules/jsxc/tests/test_functional.py b/plinth/modules/jsxc/tests/test_functional.py new file mode 100644 index 000000000..47f30123e --- /dev/null +++ b/plinth/modules/jsxc/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for jsxc app. +""" + +from pytest_bdd import scenarios + +scenarios('jsxc.feature') diff --git a/functional_tests/features/matrixsynapse.feature b/plinth/modules/matrixsynapse/tests/matrixsynapse.feature similarity index 100% rename from functional_tests/features/matrixsynapse.feature rename to plinth/modules/matrixsynapse/tests/matrixsynapse.feature diff --git a/plinth/modules/matrixsynapse/tests/test_functional.py b/plinth/modules/matrixsynapse/tests/test_functional.py new file mode 100644 index 000000000..46d251545 --- /dev/null +++ b/plinth/modules/matrixsynapse/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for matrixsynapse app. +""" + +from pytest_bdd import scenarios + +scenarios('matrixsynapse.feature') diff --git a/plinth/modules/mediawiki/tests/__init__.py b/plinth/modules/mediawiki/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/features/mediawiki.feature b/plinth/modules/mediawiki/tests/mediawiki.feature similarity index 100% rename from functional_tests/features/mediawiki.feature rename to plinth/modules/mediawiki/tests/mediawiki.feature diff --git a/plinth/modules/mediawiki/tests/test_functional.py b/plinth/modules/mediawiki/tests/test_functional.py new file mode 100644 index 000000000..62c41b3a5 --- /dev/null +++ b/plinth/modules/mediawiki/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for mediawiki app. +""" + +from pytest_bdd import scenarios + +scenarios('mediawiki.feature') diff --git a/functional_tests/features/minetest.feature b/plinth/modules/minetest/tests/minetest.feature similarity index 100% rename from functional_tests/features/minetest.feature rename to plinth/modules/minetest/tests/minetest.feature diff --git a/plinth/modules/minetest/tests/test_functional.py b/plinth/modules/minetest/tests/test_functional.py new file mode 100644 index 000000000..741bc2b22 --- /dev/null +++ b/plinth/modules/minetest/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for minetest app. +""" + +from pytest_bdd import scenarios + +scenarios('minetest.feature') diff --git a/functional_tests/features/minidlna.feature b/plinth/modules/minidlna/tests/minidlna.feature similarity index 100% rename from functional_tests/features/minidlna.feature rename to plinth/modules/minidlna/tests/minidlna.feature diff --git a/plinth/modules/minidlna/tests/test_functional.py b/plinth/modules/minidlna/tests/test_functional.py new file mode 100644 index 000000000..2b44dbc18 --- /dev/null +++ b/plinth/modules/minidlna/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for minidlna app. +""" + +from pytest_bdd import scenarios + +scenarios('minidlna.feature') diff --git a/plinth/modules/mldonkey/tests/__init__.py b/plinth/modules/mldonkey/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/features/mldonkey.feature b/plinth/modules/mldonkey/tests/mldonkey.feature similarity index 100% rename from functional_tests/features/mldonkey.feature rename to plinth/modules/mldonkey/tests/mldonkey.feature diff --git a/plinth/modules/mldonkey/tests/test_functional.py b/plinth/modules/mldonkey/tests/test_functional.py new file mode 100644 index 000000000..4bc0d706d --- /dev/null +++ b/plinth/modules/mldonkey/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for mldonkey app. +""" + +from pytest_bdd import scenarios + +scenarios('mldonkey.feature') diff --git a/functional_tests/features/monkeysphere.feature b/plinth/modules/monkeysphere/tests/monkeysphere.feature similarity index 100% rename from functional_tests/features/monkeysphere.feature rename to plinth/modules/monkeysphere/tests/monkeysphere.feature diff --git a/plinth/modules/monkeysphere/tests/test_functional.py b/plinth/modules/monkeysphere/tests/test_functional.py new file mode 100644 index 000000000..f475b9320 --- /dev/null +++ b/plinth/modules/monkeysphere/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for monkeysphere app. +""" + +from pytest_bdd import scenarios + +scenarios('monkeysphere.feature') diff --git a/functional_tests/features/mumble.feature b/plinth/modules/mumble/tests/mumble.feature similarity index 100% rename from functional_tests/features/mumble.feature rename to plinth/modules/mumble/tests/mumble.feature diff --git a/plinth/modules/mumble/tests/test_functional.py b/plinth/modules/mumble/tests/test_functional.py new file mode 100644 index 000000000..1a58df51b --- /dev/null +++ b/plinth/modules/mumble/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for mumble app. +""" + +from pytest_bdd import scenarios + +scenarios('mumble.feature') diff --git a/functional_tests/features/openvpn.feature b/plinth/modules/openvpn/tests/openvpn.feature similarity index 100% rename from functional_tests/features/openvpn.feature rename to plinth/modules/openvpn/tests/openvpn.feature diff --git a/plinth/modules/openvpn/tests/test_functional.py b/plinth/modules/openvpn/tests/test_functional.py new file mode 100644 index 000000000..176632bec --- /dev/null +++ b/plinth/modules/openvpn/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for openvpn app. +""" + +from pytest_bdd import scenarios + +scenarios('openvpn.feature') diff --git a/functional_tests/features/pagekite.feature b/plinth/modules/pagekite/tests/pagekite.feature similarity index 91% rename from functional_tests/features/pagekite.feature rename to plinth/modules/pagekite/tests/pagekite.feature index 5d8afcb3b..3f6edb62c 100644 --- a/functional_tests/features/pagekite.feature +++ b/plinth/modules/pagekite/tests/pagekite.feature @@ -1,5 +1,10 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# TODO Scenario: Enable standard services +# TODO Scenario: Disable standard services +# TODO Scenario: Add custom service +# TODO Scenario: Delete custom service + @apps @pagekite Feature: Pagekite Public Visibility Configure Pagekite public visitbility server. diff --git a/plinth/modules/pagekite/tests/test_functional.py b/plinth/modules/pagekite/tests/test_functional.py new file mode 100644 index 000000000..227edad44 --- /dev/null +++ b/plinth/modules/pagekite/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for pagekite app. +""" + +from pytest_bdd import scenarios + +scenarios('pagekite.feature') diff --git a/functional_tests/features/performance.feature b/plinth/modules/performance/tests/performance.feature similarity index 100% rename from functional_tests/features/performance.feature rename to plinth/modules/performance/tests/performance.feature diff --git a/plinth/modules/performance/tests/test_functional.py b/plinth/modules/performance/tests/test_functional.py new file mode 100644 index 000000000..eed641b09 --- /dev/null +++ b/plinth/modules/performance/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for performance app. +""" + +from pytest_bdd import scenarios + +scenarios('performance.feature') diff --git a/functional_tests/features/privoxy.feature b/plinth/modules/privoxy/tests/privoxy.feature similarity index 100% rename from functional_tests/features/privoxy.feature rename to plinth/modules/privoxy/tests/privoxy.feature diff --git a/plinth/modules/privoxy/tests/test_functional.py b/plinth/modules/privoxy/tests/test_functional.py new file mode 100644 index 000000000..10638de5d --- /dev/null +++ b/plinth/modules/privoxy/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for privoxy app. +""" + +from pytest_bdd import scenarios + +scenarios('privoxy.feature') diff --git a/functional_tests/features/quassel.feature b/plinth/modules/quassel/tests/quassel.feature similarity index 100% rename from functional_tests/features/quassel.feature rename to plinth/modules/quassel/tests/quassel.feature diff --git a/plinth/modules/quassel/tests/test_functional.py b/plinth/modules/quassel/tests/test_functional.py new file mode 100644 index 000000000..a9ddd2f57 --- /dev/null +++ b/plinth/modules/quassel/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for quassel app. +""" + +from pytest_bdd import scenarios + +scenarios('quassel.feature') diff --git a/functional_tests/features/radicale.feature b/plinth/modules/radicale/tests/radicale.feature similarity index 100% rename from functional_tests/features/radicale.feature rename to plinth/modules/radicale/tests/radicale.feature diff --git a/plinth/modules/radicale/tests/test_functional.py b/plinth/modules/radicale/tests/test_functional.py new file mode 100644 index 000000000..5af778039 --- /dev/null +++ b/plinth/modules/radicale/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for radicale app. +""" + +from pytest_bdd import scenarios + +scenarios('radicale.feature') diff --git a/functional_tests/features/roundcube.feature b/plinth/modules/roundcube/tests/roundcube.feature similarity index 100% rename from functional_tests/features/roundcube.feature rename to plinth/modules/roundcube/tests/roundcube.feature diff --git a/plinth/modules/roundcube/tests/test_functional.py b/plinth/modules/roundcube/tests/test_functional.py new file mode 100644 index 000000000..0aaee4b5e --- /dev/null +++ b/plinth/modules/roundcube/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for roundcube app. +""" + +from pytest_bdd import scenarios + +scenarios('roundcube.feature') diff --git a/functional_tests/features/samba.feature b/plinth/modules/samba/tests/samba.feature similarity index 100% rename from functional_tests/features/samba.feature rename to plinth/modules/samba/tests/samba.feature diff --git a/plinth/modules/samba/tests/test_functional.py b/plinth/modules/samba/tests/test_functional.py new file mode 100644 index 000000000..237a1171c --- /dev/null +++ b/plinth/modules/samba/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for samba app. +""" + +from pytest_bdd import scenarios + +scenarios('samba.feature') diff --git a/plinth/modules/searx/tests/__init__.py b/plinth/modules/searx/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/features/searx.feature b/plinth/modules/searx/tests/searx.feature similarity index 100% rename from functional_tests/features/searx.feature rename to plinth/modules/searx/tests/searx.feature diff --git a/plinth/modules/searx/tests/test_functional.py b/plinth/modules/searx/tests/test_functional.py new file mode 100644 index 000000000..459de6735 --- /dev/null +++ b/plinth/modules/searx/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for searx app. +""" + +from pytest_bdd import scenarios + +scenarios('searx.feature') diff --git a/functional_tests/features/security.feature b/plinth/modules/security/tests/security.feature similarity index 100% rename from functional_tests/features/security.feature rename to plinth/modules/security/tests/security.feature diff --git a/plinth/modules/security/tests/test_functional.py b/plinth/modules/security/tests/test_functional.py new file mode 100644 index 000000000..af98e32d5 --- /dev/null +++ b/plinth/modules/security/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for security app. +""" + +from pytest_bdd import scenarios + +scenarios('security.feature') diff --git a/functional_tests/features/shadowsocks.feature b/plinth/modules/shadowsocks/tests/shadowsocks.feature similarity index 100% rename from functional_tests/features/shadowsocks.feature rename to plinth/modules/shadowsocks/tests/shadowsocks.feature diff --git a/plinth/modules/shadowsocks/tests/test_functional.py b/plinth/modules/shadowsocks/tests/test_functional.py new file mode 100644 index 000000000..3ee9d1237 --- /dev/null +++ b/plinth/modules/shadowsocks/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for shadowsocks app. +""" + +from pytest_bdd import scenarios + +scenarios('shadowsocks.feature') diff --git a/plinth/modules/sharing/tests/__init__.py b/plinth/modules/sharing/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/features/sharing.feature b/plinth/modules/sharing/tests/sharing.feature similarity index 100% rename from functional_tests/features/sharing.feature rename to plinth/modules/sharing/tests/sharing.feature diff --git a/plinth/modules/sharing/tests/test_functional.py b/plinth/modules/sharing/tests/test_functional.py new file mode 100644 index 000000000..974840cec --- /dev/null +++ b/plinth/modules/sharing/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for sharing app. +""" + +from pytest_bdd import scenarios + +scenarios('sharing.feature') diff --git a/functional_tests/features/storage_snapshots.feature b/plinth/modules/snapshot/tests/snapshot.feature similarity index 100% rename from functional_tests/features/storage_snapshots.feature rename to plinth/modules/snapshot/tests/snapshot.feature diff --git a/plinth/modules/snapshot/tests/test_functional.py b/plinth/modules/snapshot/tests/test_functional.py new file mode 100644 index 000000000..4fc5aee8d --- /dev/null +++ b/plinth/modules/snapshot/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for snapshot app. +""" + +from pytest_bdd import scenarios + +scenarios('snapshot.feature') diff --git a/functional_tests/features/ssh.feature b/plinth/modules/ssh/tests/ssh.feature similarity index 100% rename from functional_tests/features/ssh.feature rename to plinth/modules/ssh/tests/ssh.feature diff --git a/plinth/modules/ssh/tests/test_functional.py b/plinth/modules/ssh/tests/test_functional.py new file mode 100644 index 000000000..6b239f3ea --- /dev/null +++ b/plinth/modules/ssh/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for ssh app. +""" + +from pytest_bdd import scenarios + +scenarios('ssh.feature') diff --git a/plinth/modules/sso/tests/__init__.py b/plinth/modules/sso/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/features/single_sign_on.feature b/plinth/modules/sso/tests/sso.feature similarity index 100% rename from functional_tests/features/single_sign_on.feature rename to plinth/modules/sso/tests/sso.feature diff --git a/plinth/modules/sso/tests/test_functional.py b/plinth/modules/sso/tests/test_functional.py new file mode 100644 index 000000000..3af0e47eb --- /dev/null +++ b/plinth/modules/sso/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for sso app. +""" + +from pytest_bdd import scenarios + +scenarios('sso.feature') diff --git a/functional_tests/features/storage.feature b/plinth/modules/storage/tests/storage.feature similarity index 100% rename from functional_tests/features/storage.feature rename to plinth/modules/storage/tests/storage.feature diff --git a/plinth/modules/storage/tests/test_functional.py b/plinth/modules/storage/tests/test_functional.py new file mode 100644 index 000000000..737f32ef1 --- /dev/null +++ b/plinth/modules/storage/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for storage app. +""" + +from pytest_bdd import scenarios + +scenarios('storage.feature') diff --git a/plinth/modules/syncthing/tests/__init__.py b/plinth/modules/syncthing/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/features/syncthing.feature b/plinth/modules/syncthing/tests/syncthing.feature similarity index 100% rename from functional_tests/features/syncthing.feature rename to plinth/modules/syncthing/tests/syncthing.feature diff --git a/plinth/modules/syncthing/tests/test_functional.py b/plinth/modules/syncthing/tests/test_functional.py new file mode 100644 index 000000000..eac5eb009 --- /dev/null +++ b/plinth/modules/syncthing/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for syncthing app. +""" + +from pytest_bdd import scenarios + +scenarios('syncthing.feature') diff --git a/plinth/modules/tahoe/tests/__init__.py b/plinth/modules/tahoe/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/features/tahoe.feature b/plinth/modules/tahoe/tests/tahoe.feature similarity index 100% rename from functional_tests/features/tahoe.feature rename to plinth/modules/tahoe/tests/tahoe.feature diff --git a/plinth/modules/tahoe/tests/test_functional.py b/plinth/modules/tahoe/tests/test_functional.py new file mode 100644 index 000000000..899cc62c2 --- /dev/null +++ b/plinth/modules/tahoe/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for tahoe app. +""" + +from pytest_bdd import scenarios + +scenarios('tahoe.feature') diff --git a/plinth/modules/tor/tests/test_functional.py b/plinth/modules/tor/tests/test_functional.py new file mode 100644 index 000000000..bad412e97 --- /dev/null +++ b/plinth/modules/tor/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for tor app. +""" + +from pytest_bdd import scenarios + +scenarios('tor.feature') diff --git a/functional_tests/features/tor.feature b/plinth/modules/tor/tests/tor.feature similarity index 100% rename from functional_tests/features/tor.feature rename to plinth/modules/tor/tests/tor.feature diff --git a/plinth/modules/transmission/tests/test_functional.py b/plinth/modules/transmission/tests/test_functional.py new file mode 100644 index 000000000..1ece1c1b3 --- /dev/null +++ b/plinth/modules/transmission/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for transmission app. +""" + +from pytest_bdd import scenarios + +scenarios('transmission.feature') diff --git a/functional_tests/features/transmission.feature b/plinth/modules/transmission/tests/transmission.feature similarity index 100% rename from functional_tests/features/transmission.feature rename to plinth/modules/transmission/tests/transmission.feature diff --git a/plinth/modules/ttrss/tests/test_functional.py b/plinth/modules/ttrss/tests/test_functional.py new file mode 100644 index 000000000..a94acba7b --- /dev/null +++ b/plinth/modules/ttrss/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for ttrss app. +""" + +from pytest_bdd import scenarios + +scenarios('ttrss.feature') diff --git a/functional_tests/features/ttrss.feature b/plinth/modules/ttrss/tests/ttrss.feature similarity index 100% rename from functional_tests/features/ttrss.feature rename to plinth/modules/ttrss/tests/ttrss.feature diff --git a/plinth/modules/upgrades/tests/test_functional.py b/plinth/modules/upgrades/tests/test_functional.py new file mode 100644 index 000000000..272599b14 --- /dev/null +++ b/plinth/modules/upgrades/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for upgrades app. +""" + +from pytest_bdd import scenarios + +scenarios('upgrades.feature') diff --git a/functional_tests/features/upgrades.feature b/plinth/modules/upgrades/tests/upgrades.feature similarity index 100% rename from functional_tests/features/upgrades.feature rename to plinth/modules/upgrades/tests/upgrades.feature diff --git a/plinth/modules/users/tests/test_functional.py b/plinth/modules/users/tests/test_functional.py new file mode 100644 index 000000000..92b26c540 --- /dev/null +++ b/plinth/modules/users/tests/test_functional.py @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +""" +Functional, browser based tests for users app. +""" + +from pytest_bdd import scenarios + +scenarios('users.feature') diff --git a/functional_tests/features/users_and_groups.feature b/plinth/modules/users/tests/users.feature similarity index 81% rename from functional_tests/features/users_and_groups.feature rename to plinth/modules/users/tests/users.feature index 19c1c4774..52ce217f0 100644 --- a/functional_tests/features/users_and_groups.feature +++ b/plinth/modules/users/tests/users.feature @@ -1,5 +1,13 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# TODO Scenario: Add user to wiki group +# TODO Scenario: Remove user from wiki group +# TODO Scenario: Set user SSH key +# TODO Scenario: Clear user SSH key +# TODO Scenario: Make user inactive +# TODO Scenario: Make user active +# TODO Scenario: Change user password + @system @essential @users_groups Feature: Users and Groups Manage users and groups. diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/config.ini b/plinth/tests/functional/config.ini similarity index 100% rename from functional_tests/config.ini rename to plinth/tests/functional/config.ini diff --git a/functional_tests/data/sample.torrent b/plinth/tests/functional/data/sample.torrent similarity index 100% rename from functional_tests/data/sample.torrent rename to plinth/tests/functional/data/sample.torrent diff --git a/functional_tests/install.sh b/plinth/tests/functional/install.sh similarity index 100% rename from functional_tests/install.sh rename to plinth/tests/functional/install.sh diff --git a/plinth/tests/functional/step_definitions/__init__.py b/plinth/tests/functional/step_definitions/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/functional_tests/step_definitions/application.py b/plinth/tests/functional/step_definitions/application.py similarity index 99% rename from functional_tests/step_definitions/application.py rename to plinth/tests/functional/step_definitions/application.py index 88f2328df..5019f3f70 100644 --- a/functional_tests/step_definitions/application.py +++ b/plinth/tests/functional/step_definitions/application.py @@ -4,7 +4,7 @@ import pytest import splinter from pytest_bdd import given, parsers, then, when -from support import application +from ..support import application @given(parsers.parse('the {app_name:w} application is installed')) diff --git a/functional_tests/step_definitions/interface.py b/plinth/tests/functional/step_definitions/interface.py similarity index 98% rename from functional_tests/step_definitions/interface.py rename to plinth/tests/functional/step_definitions/interface.py index 0e904d35a..512d7d953 100644 --- a/functional_tests/step_definitions/interface.py +++ b/plinth/tests/functional/step_definitions/interface.py @@ -2,7 +2,7 @@ from pytest_bdd import given, parsers, then, when -from support import config, interface +from ..support import config, interface default_url = config['DEFAULT']['url'] diff --git a/functional_tests/step_definitions/service.py b/plinth/tests/functional/step_definitions/service.py similarity index 94% rename from functional_tests/step_definitions/service.py rename to plinth/tests/functional/step_definitions/service.py index 83a0a0017..ec543d136 100644 --- a/functional_tests/step_definitions/service.py +++ b/plinth/tests/functional/step_definitions/service.py @@ -2,8 +2,8 @@ from pytest_bdd import parsers, then -from support import service -from support.service import eventually +from ..support import service +from ..support.service import eventually @then(parsers.parse('the {service_name:w} service should be running')) diff --git a/functional_tests/step_definitions/site.py b/plinth/tests/functional/step_definitions/site.py similarity index 99% rename from functional_tests/step_definitions/site.py rename to plinth/tests/functional/step_definitions/site.py index 90009615f..038cc9df0 100644 --- a/functional_tests/step_definitions/site.py +++ b/plinth/tests/functional/step_definitions/site.py @@ -2,7 +2,7 @@ from pytest_bdd import given, parsers, then, when -from support import interface, site +from ..support import interface, site @then(parsers.parse('the {site_name:w} site should be available')) diff --git a/functional_tests/step_definitions/system.py b/plinth/tests/functional/step_definitions/system.py similarity index 99% rename from functional_tests/step_definitions/system.py rename to plinth/tests/functional/step_definitions/system.py index 2eb70e629..f4913d5c2 100644 --- a/functional_tests/step_definitions/system.py +++ b/plinth/tests/functional/step_definitions/system.py @@ -6,7 +6,7 @@ import time from pytest import fixture from pytest_bdd import given, parsers, then, when -from support import config, system +from ..support import system language_codes = { 'Deutsch': 'de', diff --git a/functional_tests/support/__init__.py b/plinth/tests/functional/support/__init__.py similarity index 100% rename from functional_tests/support/__init__.py rename to plinth/tests/functional/support/__init__.py diff --git a/functional_tests/support/application.py b/plinth/tests/functional/support/application.py similarity index 99% rename from functional_tests/support/application.py rename to plinth/tests/functional/support/application.py index 6f52037dd..9fbb1e2c4 100644 --- a/functional_tests/support/application.py +++ b/plinth/tests/functional/support/application.py @@ -13,9 +13,9 @@ from time import sleep import requests import splinter -from support import config, interface, site -from support.interface import submit -from support.service import eventually, wait_for_page_update +from . import config, interface, site +from .interface import submit +from .service import eventually, wait_for_page_update # unlisted apps just use the app_name as module name app_module = { diff --git a/functional_tests/support/interface.py b/plinth/tests/functional/support/interface.py similarity index 99% rename from functional_tests/support/interface.py rename to plinth/tests/functional/support/interface.py index 19dfa38d0..5e9f43339 100644 --- a/functional_tests/support/interface.py +++ b/plinth/tests/functional/support/interface.py @@ -6,8 +6,7 @@ import tempfile import requests -from support import config - +from . import config from .service import wait_for_page_update sys_modules = [ diff --git a/functional_tests/support/service.py b/plinth/tests/functional/support/service.py similarity index 98% rename from functional_tests/support/service.py rename to plinth/tests/functional/support/service.py index 2ddbe5ef9..02b5d83b8 100644 --- a/functional_tests/support/service.py +++ b/plinth/tests/functional/support/service.py @@ -1,12 +1,12 @@ # SPDX-License-Identifier: AGPL-3.0-or-later -from contextlib import contextmanager import time +from contextlib import contextmanager from selenium.common.exceptions import StaleElementReferenceException from selenium.webdriver.support.ui import WebDriverWait -from support import interface +from . import interface # unlisted services just use the service_name as module name service_module = { @@ -61,6 +61,7 @@ class page_loaded(): - expected_url (optional): Wait for the URL to become . This can be necessary to wait for a redirect to finish. """ + def __init__(self, element, expected_url=None): self.element = element self.expected_url = expected_url diff --git a/functional_tests/support/site.py b/plinth/tests/functional/support/site.py similarity index 99% rename from functional_tests/support/site.py rename to plinth/tests/functional/support/site.py index 1fe6a1102..0217b65e4 100644 --- a/functional_tests/support/site.py +++ b/plinth/tests/functional/support/site.py @@ -9,8 +9,8 @@ import requests from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys -from support import application, config, interface, system -from support.service import eventually, wait_for_page_update +from . import application, config, interface, system +from .service import eventually, wait_for_page_update # unlisted sites just use '/' + site_name as url site_url = { diff --git a/functional_tests/support/system.py b/plinth/tests/functional/support/system.py similarity index 99% rename from functional_tests/support/system.py rename to plinth/tests/functional/support/system.py index dee5af398..bd8e3df97 100644 --- a/functional_tests/support/system.py +++ b/plinth/tests/functional/support/system.py @@ -6,7 +6,7 @@ from urllib.parse import urlparse import requests from . import application, config -from .interface import default_url, nav_to_module, submit +from .interface import nav_to_module, submit from .service import wait_for_page_update config_page_title_language_map = {