mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
roundcube: 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
c120411846
commit
60236376c2
@ -1,26 +0,0 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@apps @roundcube
|
||||
Feature: Roundcube Email Client
|
||||
Run webmail client.
|
||||
|
||||
Background:
|
||||
Given I'm a logged in user
|
||||
Given the roundcube application is installed
|
||||
|
||||
Scenario: Enable roundcube application
|
||||
Given the roundcube application is disabled
|
||||
When I enable the roundcube application
|
||||
Then the roundcube site should be available
|
||||
|
||||
@backups
|
||||
Scenario: Backup and restore roundcube
|
||||
Given the roundcube application is enabled
|
||||
When I create a backup of the roundcube app data with name test_roundcube
|
||||
And I restore the roundcube app data backup with name test_roundcube
|
||||
Then the roundcube site should be available
|
||||
|
||||
Scenario: Disable roundcube application
|
||||
Given the roundcube application is enabled
|
||||
When I disable the roundcube application
|
||||
Then the roundcube site should not be available
|
||||
@ -3,6 +3,36 @@
|
||||
Functional, browser based tests for roundcube app.
|
||||
"""
|
||||
|
||||
from pytest_bdd import scenarios
|
||||
import pytest
|
||||
from plinth.tests import functional
|
||||
|
||||
scenarios('roundcube.feature')
|
||||
pytestmark = [pytest.mark.apps, pytest.mark.roundcube]
|
||||
|
||||
|
||||
@pytest.fixture(scope='module', autouse=True)
|
||||
def fixture_background(session_browser):
|
||||
"""Login and install the app."""
|
||||
functional.login(session_browser)
|
||||
functional.install(session_browser, 'roundcube')
|
||||
yield
|
||||
functional.app_disable(session_browser, 'roundcube')
|
||||
|
||||
|
||||
def test_enable_disable(session_browser):
|
||||
"""Test enabling the app."""
|
||||
functional.app_disable(session_browser, 'roundcube')
|
||||
|
||||
functional.app_enable(session_browser, 'roundcube')
|
||||
assert functional.is_available(session_browser, 'roundcube')
|
||||
|
||||
functional.app_disable(session_browser, 'roundcube')
|
||||
assert not functional.is_available(session_browser, 'roundcube')
|
||||
|
||||
|
||||
@pytest.mark.backups
|
||||
def test_backup_restore(session_browser):
|
||||
"""Test backup and restore."""
|
||||
functional.app_enable(session_browser, 'roundcube')
|
||||
functional.backup_create(session_browser, 'roundcube', 'test_roundcube')
|
||||
functional.backup_restore(session_browser, 'roundcube', 'test_roundcube')
|
||||
assert functional.is_available(session_browser, 'roundcube')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user