mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
- 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 <sunil@medhas.org> Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
94 lines
3.1 KiB
Gherkin
94 lines
3.1 KiB
Gherkin
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
@apps @gitweb @sso
|
|
Feature: gitweb Simple Git Hosting
|
|
Git web interface.
|
|
|
|
Background:
|
|
Given I'm a logged in user
|
|
And the gitweb application is installed
|
|
|
|
Scenario: Enable gitweb application
|
|
Given the gitweb application is disabled
|
|
When I enable the gitweb application
|
|
Then the gitweb site should be available
|
|
|
|
Scenario: Create public repository
|
|
Given the gitweb application is enabled
|
|
And a public repository that doesn't exist
|
|
When I create the repository
|
|
Then the repository should be listed as a public
|
|
And the repository should be listed on gitweb
|
|
|
|
Scenario: Create private repository
|
|
Given the gitweb application is enabled
|
|
And a private repository that doesn't exist
|
|
When I create the repository
|
|
Then the repository should be listed as a private
|
|
And the repository should be listed on gitweb
|
|
|
|
Scenario: Delete repository
|
|
Given the gitweb application is enabled
|
|
And a repository
|
|
When I delete the repository
|
|
Then the repository should not be listed
|
|
|
|
@backups
|
|
Scenario: Backup and restore gitweb
|
|
Given the gitweb application is enabled
|
|
And a repository
|
|
When I create a backup of the gitweb app data with name test_gitweb
|
|
And I delete the repository
|
|
And I restore the gitweb app data backup with name test_gitweb
|
|
Then the repository should be restored
|
|
And the gitweb site should be available
|
|
|
|
Scenario: Public gitweb site shows only public repositories
|
|
Given the gitweb application is enabled
|
|
And both public and private repositories exist
|
|
When I log out
|
|
Then the public repository should be listed on gitweb
|
|
And the private repository should not be listed on gitweb
|
|
|
|
Scenario: Gitweb is not public if there are only private repositories
|
|
Given the gitweb application is enabled
|
|
And at least one repository exists
|
|
And all repositories are private
|
|
When I log out
|
|
And I access gitweb application
|
|
Then I should be prompted for login
|
|
And gitweb app should not be visible on the front page
|
|
|
|
Scenario: Edit repository metadata
|
|
Given the gitweb application is enabled
|
|
And a public repository that doesn't exist
|
|
And a repository metadata:
|
|
description: Test Description
|
|
owner: Test Owner
|
|
access: private
|
|
When I create the repository
|
|
And I set the metadata of the repository
|
|
Then the metadata of the repository should be as set
|
|
|
|
Scenario: Access public repository with git client
|
|
Given the gitweb application is enabled
|
|
And a public repository
|
|
When using a git client
|
|
Then the repository should be publicly readable
|
|
And the repository should not be publicly writable
|
|
And the repository should be privately writable
|
|
|
|
Scenario: Access private repository with git client
|
|
Given the gitweb application is enabled
|
|
And a private repository
|
|
When using a git client
|
|
Then the repository should not be publicly readable
|
|
And the repository should not be publicly writable
|
|
And the repository should be privately readable
|
|
And the repository should be privately writable
|
|
|
|
Scenario: Disable gitweb application
|
|
Given the gitweb application is enabled
|
|
When I disable the gitweb application
|
|
Then the gitweb site should not be available
|