From c52325f01d7d8c0c440544c7c61cda2920ee4a88 Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Thu, 26 Feb 2026 10:31:28 +0100 Subject: [PATCH 1/4] AutomationSAT-32425 --- tests/foreman/ui/test_host.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index a0caf493ae8..35d0e52a559 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -4248,3 +4248,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 the Library option is displayed in the Create Host form + + :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 Organization') + session.location.select(loc_name='Any 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 From 9f724d747a0ba022d323ae46755e372a87d2a6ed Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Thu, 26 Feb 2026 10:34:27 +0100 Subject: [PATCH 2/4] updateDocstring --- tests/foreman/ui/test_host.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 35d0e52a559..639cd022c20 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -4252,7 +4252,8 @@ def test_assign_different_cv_from_same_env( def test_positive_only_single_library_option_in_create_form(target_sat): """ - Ensure that only the Library option is displayed in the Create Host form + 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 From 25d210740c838f6448c88a64f63d6974a761241d Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Thu, 26 Feb 2026 11:32:35 +0100 Subject: [PATCH 3/4] Address comments --- tests/foreman/ui/test_host.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 639cd022c20..27177ae46ad 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -29,9 +29,11 @@ from robottelo.config import settings from robottelo.constants import ( ANY_CONTEXT, + ANY_LOCATION, DEFAULT_ARCHITECTURE, DEFAULT_CV, DEFAULT_LOC, + DEFAULT_ORG, ENVIRONMENT, FAKE_1_CUSTOM_PACKAGE, FAKE_7_CUSTOM_PACKAGE, @@ -4251,8 +4253,7 @@ def test_assign_different_cv_from_same_env( 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 + """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 @@ -4269,8 +4270,8 @@ def test_positive_only_single_library_option_in_create_form(target_sat): :customerscenario: true """ with target_sat.ui_session() as session: - session.organization.select(org_name='Default Organization') - session.location.select(loc_name='Any location') + session.organization.select(org_name=DEFAULT_ORG) + session.location.select(loc_name=ANY_LOCATION) create_form = session.host.get_create_form() create_form.host.lce.open_filter.click() # Check that 'Library' appears just once From e57977379caf0ea67956a8b74a15348da3cb3d31 Mon Sep 17 00:00:00 2001 From: Ladislav Vasina Date: Thu, 26 Feb 2026 11:38:21 +0100 Subject: [PATCH 4/4] FixAnyLocation --- tests/foreman/ui/test_host.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 27177ae46ad..9170be0a87e 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -29,7 +29,6 @@ from robottelo.config import settings from robottelo.constants import ( ANY_CONTEXT, - ANY_LOCATION, DEFAULT_ARCHITECTURE, DEFAULT_CV, DEFAULT_LOC, @@ -4271,7 +4270,7 @@ def test_positive_only_single_library_option_in_create_form(target_sat): """ with target_sat.ui_session() as session: session.organization.select(org_name=DEFAULT_ORG) - session.location.select(loc_name=ANY_LOCATION) + 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