diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index a0caf493ae8..9170be0a87e 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -32,6 +32,7 @@ DEFAULT_ARCHITECTURE, DEFAULT_CV, DEFAULT_LOC, + DEFAULT_ORG, ENVIRONMENT, FAKE_1_CUSTOM_PACKAGE, FAKE_7_CUSTOM_PACKAGE, @@ -4248,3 +4249,29 @@ def test_assign_different_cv_from_same_env( cv_env = session.host_new.get_content_view_envs(rhel_contenthost.hostname)[0] assert cv_env['content_view'] == cv.name + + +def test_positive_only_single_library_option_in_create_form(target_sat): + """Ensure that only 1 Library option is displayed in the Create Host form + when location is set to "Any location" + + :id: 559f6324-dc17-4274-99f5-957ef0a2faf0 + + :steps: + 1. Set location to "Any location" + 2. Read LCE dropdown options in the Create host form + + :expectedresults: + 1. Only 1 Library option is displayed + + :verifies: SAT-42710, SAT-32425 + + :customerscenario: true + """ + with target_sat.ui_session() as session: + session.organization.select(org_name=DEFAULT_ORG) + session.location.select(loc_name=ANY_CONTEXT['location']) + create_form = session.host.get_create_form() + create_form.host.lce.open_filter.click() + # Check that 'Library' appears just once + assert create_form.host.lce.filter_content.read().count('Library') == 1