Skip to content

Commit

Permalink
hosts: test correct page redirect after host edit
Browse files Browse the repository at this point in the history
Component evaluation - SAT-21625
https://bugzilla.redhat.com/2166303

Check that after editing a host without making any changes(*),
the page is correctly redirected to the host details page.

(*) Making or not making any changes in the edit dialog
actually does not matter.
  • Loading branch information
pnovotny committed Apr 25, 2024
1 parent c37a15c commit ed86589
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/foreman/ui/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -1944,3 +1944,29 @@ def test_change_content_source(session, change_content_source_prep, rhel_content
rhel_contenthost_post_values['lifecycle_environment']['name']
== rhel_contenthost_post_values['lifecycle_environment']['name']
)


@pytest.mark.tier3
@pytest.mark.rhel_ver_match('8')
def test_positive_page_redirect_after_update(target_sat, current_sat_location):
"""Check that page redirects correctly after editing a host without making any changes.
:id: 29c3397e-0010-11ef-bca4-000c2989e153
:steps:
1. Go to All Hosts page.
2. Edit a host. Using the Sat. host is sufficient, no other host needs to be created or registered,
because we need just a host with FQDN.
3. Submit the host edit dialog without making any changes.
:expectedresults: The page should be redirected to the host details page.
:BZ: 2166303
"""
client = target_sat
with target_sat.ui_session() as session:
session.location.select(loc_name=current_sat_location.name)
session.host_new.update(client.hostname, {})

assert 'page-not-found' not in session.browser.url
assert client.hostname in session.browser.url

0 comments on commit ed86589

Please sign in to comment.