mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +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.
|
||||
"""
|
||||
import pytest
|
||||
from pytest_bdd import given, parsers, scenarios, then
|
||||
|
||||
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')
|
||||
def storage_root_disk_is_shown(session_browser):
|
||||
assert _is_root_disk_shown(session_browser)
|
||||
@pytest.fixture(scope='module', autouse=True)
|
||||
def fixture_background(session_browser):
|
||||
"""Login."""
|
||||
functional.login(session_browser)
|
||||
|
||||
|
||||
@given(parsers.parse("I'm on the {name:w} page"))
|
||||
def go_to_module(session_browser, name):
|
||||
def test_list_disks(session_browser):
|
||||
"""Test that root disk is shown on storage page."""
|
||||
if functional.running_inside_container:
|
||||
pytest.skip('Storage doesn\'t work inside a container')
|
||||
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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user