Skip to content

Commit

Permalink
[6.12.z] Modify registration UI tests for operating-system field
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Gauravtalreja1 committed Dec 26, 2023
1 parent 4ec8cd8 commit a4ea8af
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/foreman/ui/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
def test_positive_verify_default_values_for_global_registration(
module_target_sat,
default_org,
default_os,
):
"""Check for all the Default values pre-populated in the global registration template
Expand All @@ -37,19 +38,21 @@ def test_positive_verify_default_values_for_global_registration(
:steps:
1. Check for the default values in the global registration template
"""
module_target_sat.cli_factory.make_activation_key(
ak = module_target_sat.cli_factory.make_activation_key(
{'organization-id': default_org.id, 'name': gen_string('alpha')}
)
with module_target_sat.ui_session() as session:
cmd = session.host.get_register_command(
{'general.activation_keys': ak.name, 'general.operating_system': default_os.title},
full_read=True,
)
assert cmd['general']['organization'] == 'Default Organization'
assert cmd['general']['location'] == 'Default Location'
assert cmd['general']['capsule'] == 'Nothing to select.'
assert cmd['general']['operating_system'] == ''
assert cmd['general']['operating_system'] == default_os.title
assert cmd['general']['host_group'] == 'Nothing to select.'
assert cmd['general']['insecure'] is False
assert cmd['general']['activation_keys'][0] == ak.name
assert cmd['advanced']['setup_rex'] == 'Inherit from host parameter (yes)'
assert cmd['advanced']['setup_insights'] == 'Inherit from host parameter (yes)'
assert cmd['advanced']['token_life_time'] == '4'
Expand All @@ -65,6 +68,7 @@ def test_positive_org_loc_change_for_registration(
module_org,
module_location,
target_sat,
default_os,
):
"""Changing the organization and location to check if correct org and loc is updated on the global registration page as well as in the command
Expand All @@ -78,13 +82,14 @@ def test_positive_org_loc_change_for_registration(
"""
new_org = target_sat.api.Organization().create()
new_loc = target_sat.api.Location().create()
target_sat.api.ActivationKey(organization=new_org).create()
new_ak = target_sat.api.ActivationKey(organization=new_org).create()
with target_sat.ui_session() as session:
session.organization.select(org_name=module_org.name)
session.location.select(loc_name=module_location.name)
cmd = session.host.get_register_command(
{
'general.activation_keys': module_activation_key.name,
'general.operating_system': default_os.title,
}
)
expected_pairs = [
Expand All @@ -98,7 +103,8 @@ def test_positive_org_loc_change_for_registration(
session.location.select(loc_name=new_loc.name)
cmd = session.host.get_register_command(
{
'general.activation_keys': module_activation_key.name,
'general.activation_keys': new_ak.name,
'general.operating_system': default_os.title,
}
)
expected_pairs = [
Expand Down

0 comments on commit a4ea8af

Please sign in to comment.