Skip to content

Commit

Permalink
Add a test case for the reclaim space warning hiding (#16821)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik authored Oct 31, 2024
1 parent a54eb8b commit 4fa06b4
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/foreman/ui/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,42 @@ def test_positive_content_counts_for_mixed_cv(
session.capsule.edit(module_capsule_configured.hostname, remove_all_lces=True)
details = session.capsule.read_details(module_capsule_configured.hostname)
assert 'content' not in details, 'Content still listed for removed LCEs'


@pytest.mark.parametrize('setting_update', ['hide_reclaim_space_warning=False'], indirect=True)
def test_hide_reclaim_space_warning(module_target_sat, setting_update):
"""Verify the Reclaim space warning hiding via Settings works as expected.
:id: aae93b89-0e8d-41e6-9e5f-40916a44d195
:parametrized: yes
:verifies: SAT-18549
:setup:
1. Hiding is turned off.
:steps:
1. Navigate to the internal capsule details page, verify the warning is displayed.
2. Turn the hiding on.
3. Navigate to the internal capsule details page, verify the warning is gone.
:expectedresults:
1. The Reclaim space warning message can be hidden via Settings as needed.
"""
with module_target_sat.ui_session() as session:
# Navigate to the internal capsule details page, verify the warning is displayed.
details = session.capsule.read_details(module_target_sat.hostname)
assert 'reclaim_space_warning' in details['overview']
assert (
'Warning: reclaiming space will delete all cached content'
in details['overview']['reclaim_space_warning']
)

# Turn the hiding on.
setting_update.value = True
setting_update.update({'value'})

# Navigate to the internal capsule details page, verify the warning is gone.
details = session.capsule.read_details(module_target_sat.hostname)
assert 'reclaim_space_warning' not in details['overview']

0 comments on commit 4fa06b4

Please sign in to comment.