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.15.z] [E2E] Recalculate applicability before UI session, fix navigation failure #14110

Conversation

Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #14095

Problem Statement

  • Occasional e2e failure in one or two parameters for UI::Errata::test_end_to_end[rhel7, 8, 9].
  • Upon asserting one applicable errata, after installing an outdated applicable package.
tests/foreman/ui/test_errata.py:396: in test_end_to_end
    assert (applicable_errata == 1)
E   AssertionError: Expected 1 applicable errata: RHSA-2012:0055, after setup. Got 0
E   assert 0 == 1
  • Follow-up after resolving AssertionError, now failing to navigate to [Details]
    at Ln405: assert session.contenthost.search_content_hosts(...)
navmazing._errors.NavigationTriesExceeded: Navigation failed to reach [Details] in the specified tries
>           raise NoSuchElementException(f"Could not find an element {repr(locator)}") from None
E           selenium.common.exceptions.NoSuchElementException: Message: Could not find an element ".//input[@ng-model='showInstallable']"; For documentation on this error, please visit: ...
../../lib64/python3.11/site-packages/widgetastic/browser.py:467: NoSuchElementException

The page is blank when the test fails, assert does not give the method enough time for a loaded page.
Also put up a very small change for the search_content_hosts() method- Airgun#1240.

Solution

  • To resolve applicability, after installing the outdated pkg, we need to manually recalculate errata to show up-to-date applicability in time.
  • To resolve navigation, instead of asserting directly on session.contenthost .errata methods, store the method result as a variable, giving time in case the page is slow, UI elements are not loaded yet.
    Then assert upon the variable (typically some sort of response) or expected outcome (generated task(s) etc).

PRT Case

trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py::test_end_to_end
airgun: 1240

…lure (#14095)

Recalculate applicability before session, fix nav failure.

(cherry picked from commit 21ec37b)
@Satellite-QE Satellite-QE requested a review from a team as a code owner February 16, 2024 19:22
@Satellite-QE Satellite-QE added 6.15.z Introduced in or relating directly to Satellite 6.15 Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Feb 16, 2024
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_errata.py::test_end_to_end
airgun: 1240

@damoore044 damoore044 added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Feb 16, 2024
@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 5779
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_errata.py::test_end_to_end
Test Result : ================= 3 passed, 320 warnings in 2577.27s (0:42:57) =================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 16, 2024
@Satellite-QE Satellite-QE merged commit c1fbcd5 into 6.15.z Feb 16, 2024
15 of 16 checks passed
@Satellite-QE Satellite-QE deleted the cherry-pick-6.15.z-21ec37b699f0ef769f525f510bcdc772ef9c4053 branch February 16, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants