mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
storage: 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
667f2575b6
commit
3bbbd0c812
@ -1,12 +0,0 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
|
|
||||||
@system @storage @essential
|
|
||||||
Feature: Storage
|
|
||||||
Show information about the disks.
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given I'm a logged in user
|
|
||||||
|
|
||||||
Scenario: List disks
|
|
||||||
Given I'm on the storage page
|
|
||||||
Then the root disk should be shown
|
|
||||||
@ -3,24 +3,24 @@
|
|||||||
Functional, browser based tests for storage app.
|
Functional, browser based tests for storage app.
|
||||||
"""
|
"""
|
||||||
import pytest
|
import pytest
|
||||||
from pytest_bdd import given, parsers, scenarios, then
|
|
||||||
|
|
||||||
from plinth.tests import functional
|
from plinth.tests import functional
|
||||||
|
|
||||||
scenarios('storage.feature')
|
pytestmark = [pytest.mark.system, pytest.mark.essential, pytest.mark.storage]
|
||||||
|
|
||||||
|
|
||||||
@then('the root disk should be shown')
|
@pytest.fixture(scope='module', autouse=True)
|
||||||
def storage_root_disk_is_shown(session_browser):
|
def fixture_background(session_browser):
|
||||||
assert _is_root_disk_shown(session_browser)
|
"""Login."""
|
||||||
|
functional.login(session_browser)
|
||||||
|
|
||||||
|
|
||||||
@given(parsers.parse("I'm on the {name:w} page"))
|
def test_list_disks(session_browser):
|
||||||
def go_to_module(session_browser, name):
|
"""Test that root disk is shown on storage page."""
|
||||||
if functional.running_inside_container:
|
if functional.running_inside_container:
|
||||||
pytest.skip('Storage doesn\'t work inside a container')
|
pytest.skip('Storage doesn\'t work inside a container')
|
||||||
else:
|
else:
|
||||||
functional.nav_to_module(session_browser, name)
|
functional.nav_to_module(session_browser, 'storage')
|
||||||
|
assert _is_root_disk_shown(session_browser)
|
||||||
|
|
||||||
|
|
||||||
def _is_root_disk_shown(browser):
|
def _is_root_disk_shown(browser):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user