quassel: 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:
James Valleroy 2021-09-30 12:08:12 -04:00 committed by Sunil Mohan Adapa
parent 650c16f914
commit 8daa9aa49d
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 34 additions and 29 deletions

View File

@ -1,27 +0,0 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
@apps @quassel
Feature: Quassel IRC Client
Run Quassel core.
Background:
Given I'm a logged in user
Given the quassel application is installed
Scenario: Enable quassel application
Given the quassel application is disabled
When I enable the quassel application
Then the quassel service should be running
# TODO: Improve this to actually check that data configured servers is restored.
@backups
Scenario: Backup and restore quassel
Given the quassel application is enabled
When I create a backup of the quassel app data with name test_quassel
And I restore the quassel app data backup with name test_quassel
Then the quassel service should be running
Scenario: Disable quassel application
Given the quassel application is enabled
When I disable the quassel application
Then the quassel service should not be running

View File

@ -3,6 +3,38 @@
Functional, browser based tests for quassel app.
"""
from pytest_bdd import scenarios
import pytest
from plinth.tests import functional
scenarios('quassel.feature')
pytestmark = [pytest.mark.apps, pytest.mark.quassel]
@pytest.fixture(scope='module', autouse=True)
def fixture_background(session_browser):
"""Login and install the app."""
functional.login(session_browser)
functional.install(session_browser, 'quassel')
yield
functional.app_disable(session_browser, 'quassel')
def test_enable_disable(session_browser):
"""Test enabling the app."""
functional.app_disable(session_browser, 'quassel')
functional.app_enable(session_browser, 'quassel')
assert functional.service_is_running(session_browser, 'quassel')
functional.app_disable(session_browser, 'quassel')
assert functional.service_is_not_running(session_browser, 'quassel')
# TODO: Improve this to actually check that data configured servers is
# restored.
@pytest.mark.backups
def test_backup_restore(session_browser):
"""Test backup and restore of app data."""
functional.app_enable(session_browser, 'quassel')
functional.backup_create(session_browser, 'quassel', 'test_quassel')
functional.backup_restore(session_browser, 'quassel', 'test_quassel')
assert functional.service_is_running(session_browser, 'quassel')