Skip to content

Commit

Permalink
Test for all hosts page manage columns
Browse files Browse the repository at this point in the history
  • Loading branch information
sambible committed Jun 10, 2024
1 parent 9072e6f commit 28f71d3
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions tests/foreman/ui/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,37 @@ def test_positive_manage_table_columns(
assert (column in displayed_columns) is is_displayed


@pytest.mark.tier2
def test_all_hosts_manage_columns(target_sat, function_org, new_host_ui):
"""Verify that the manage columns widget changes the columns appropriately
:id: 5e13267a-68d2-451a-ae00-6502dd5db7f4
:expectedresults: Through the widget you can change the columns on the All Hosts page
:CaseComponent:Hosts-Content
:Team: Phoenix-subscriptions
"""
columns = {
'Host group': True,
'Last report': True,
'Comment': True,
'IPv4': True,
'MAC': True,
'Sockets': True,
'Cores': True,
'RAM': True,
'Boot time': True,
}
with target_sat.ui_session() as session:
session.organization.select(function_org.name)
session.all_hosts.manage_table_columns(columns)
displayed_columns = session.all_hosts.get_displayed_table_headers()
for column, is_displayed in columns.items():
assert (column in displayed_columns) is is_displayed


@pytest.mark.tier4
def test_positive_host_details_read_templates(
session, target_sat, current_sat_org, current_sat_location
Expand Down Expand Up @@ -1849,6 +1880,37 @@ def test_all_hosts_bulk_delete(target_sat, function_org, function_location, new_
assert session.all_hosts.bulk_delete_all()


@pytest.mark.tier2
def test_multi_cv_read(target_sat, rhel_contenthost, function_org, new_host_ui):
"""Create a host setup with multi-cv, and verify that the popover shows the appropriate info
:id: ec6649df-3d3d-4557-8113-a23eee7032c9
:expectedresults: Successful read of multi-cv in Hosts UI and All Hosts UI
:CaseComponent:Hosts-Content
:Team: Phoenix-subscriptions
"""
cv1 = target_sat.api.ContentView(organization=function_org).create()
cv1.publish()
cv1 = cv1.read()
cv2 = target_sat.api.ContentView(organization=function_org).create()
cv2.publish()
cv2 = cv2.read()
lce1 = target_sat.api.LifecycleEnvironment(organization=function_org).create()
lce2 = target_sat.api.LifecycleEnvironment(organization=function_org).create()
cv1.version[0].promote(data={'environment_ids': lce1.id, 'force': False})
cv2.version[0].promote(data={'environment_ids': lce2.id, 'force': False})
rhel_contenthost.install_katello_ca(target_sat)
rhel_contenthost.register_contenthost(
org=function_org.name, lce=None, lces=f'{lce1.name}/{cv1.name},{lce2.name}/{cv2.name}'
)
with target_sat.ui_session() as session:
session.organization.select(function_org.name)
session.all_hosts.read_table()


@pytest.fixture(scope='module')
def change_content_source_prep(
module_target_sat,
Expand Down

0 comments on commit 28f71d3

Please sign in to comment.