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 21, 2024
1 parent c37a15c commit c3f7ab2
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/foreman/ui/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -1944,3 +1944,38 @@ 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(
session,
target_sat,
rhel_contenthost,
):
"""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.
3. Submit the host edit dialog without making any changes.
:expectedresults: The page should be redirected to the host details page.
:BZ: 2166303
"""
client = rhel_contenthost
client_loc = (
target_sat.api.Host()
.search(query={'search': f'name={client.hostname}'})[0]
.location.read()
.name
)
with target_sat.ui_session() as session:
session.location.select(loc_name=client_loc)
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 c3f7ab2

Please sign in to comment.