Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.13.z] Add test for show_unsupported_templates setting #13576

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions tests/foreman/ui/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,37 @@ def test_positive_entries_per_page(session, setting_update):
total_pages_str = page_content["Pagination"]['_items'].split()[-2]
total_pages = math.ceil(int(total_pages_str.split()[-1]) / property_value)
assert str(total_pages) == page_content["Pagination"]['_total_pages'].split()[-1]


@pytest.mark.tier2
def test_positive_show_unsupported_templates(request, target_sat, module_org, module_location):
"""Verify setting show_unsupported_templates with new custom template

:id: e0eaab69-4926-4c1e-b111-30c51ede273z

:Steps:
1. Goto Settings -> Provisioning tab -> Show unsupported provisioning templates

:CaseImportance: Medium

:expectedresults: Custom template aren't searchable when set to No,
and are searchable when set to Yes(default)
"""
pt = target_sat.api.ProvisioningTemplate(
name=gen_string('alpha'),
organization=[module_org],
location=[module_location],
template=gen_string('alpha'),
snippet=False,
).create()
request.addfinalizer(pt.delete)
with target_sat.ui_session() as session:
session.organization.select(org_name=module_org.name)
session.location.select(loc_name=module_location.name)
default_value = target_sat.update_setting('show_unsupported_templates', 'No')
assert not session.provisioningtemplate.search(f'name={pt.name}')

# Verify with show_unsupported_templates=Yes
target_sat.update_setting('show_unsupported_templates', default_value)
template = session.provisioningtemplate.search(f'name={pt.name}')
assert template[0]['Name'] == pt.name