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:
James Valleroy 2021-10-03 11:45:23 -04:00 committed by Sunil Mohan Adapa
parent 667f2575b6
commit 3bbbd0c812
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 9 additions and 21 deletions

View File

@ -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

View File

@ -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):