mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
sso: 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
f8258fcef4
commit
667f2575b6
@ -1,20 +0,0 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
|
|
||||||
@sso @essential @system
|
|
||||||
Feature: Single Sign On
|
|
||||||
Test Single Sign On features.
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given I'm a logged in user
|
|
||||||
Given the syncthing application is installed
|
|
||||||
Given the syncthing application is enabled
|
|
||||||
|
|
||||||
|
|
||||||
Scenario: Logged out Plinth user cannot access Syncthing web interface
|
|
||||||
Given I'm a logged out user
|
|
||||||
When I access syncthing application
|
|
||||||
Then I should be prompted for login
|
|
||||||
|
|
||||||
Scenario: Logged in Plinth user can access Syncthing web interface
|
|
||||||
When I access syncthing application
|
|
||||||
Then the syncthing site should be available
|
|
||||||
@ -3,6 +3,28 @@
|
|||||||
Functional, browser based tests for sso app.
|
Functional, browser based tests for sso app.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pytest_bdd import scenarios
|
import pytest
|
||||||
|
from plinth.tests import functional
|
||||||
|
|
||||||
scenarios('sso.feature')
|
pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.sso]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='module', autouse=True)
|
||||||
|
def fixture_background(session_browser):
|
||||||
|
"""Login and install the app."""
|
||||||
|
functional.login(session_browser)
|
||||||
|
functional.install(session_browser, 'syncthing')
|
||||||
|
functional.app_enable(session_browser, 'syncthing')
|
||||||
|
yield
|
||||||
|
functional.app_disable(session_browser, 'syncthing')
|
||||||
|
|
||||||
|
|
||||||
|
def test_app_access(session_browser):
|
||||||
|
"""Test that only logged-in users can access Syncthing web interface."""
|
||||||
|
functional.logout(session_browser)
|
||||||
|
functional.access_url(session_browser, 'syncthing')
|
||||||
|
assert functional.is_login_prompt(session_browser)
|
||||||
|
|
||||||
|
functional.login(session_browser)
|
||||||
|
functional.access_url(session_browser, 'syncthing')
|
||||||
|
assert functional.is_available(session_browser, 'syncthing')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user