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

[E2E] Recalculate applicability before UI session, fix navigation failure #14095

Merged

Conversation

damoore044
Copy link
Contributor

@damoore044 damoore044 commented Feb 15, 2024

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

@damoore044 damoore044 added CherryPick PR needs CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Feb 15, 2024
@damoore044 damoore044 requested a review from a team February 15, 2024 15:25
@damoore044 damoore044 self-assigned this Feb 15, 2024
@damoore044 damoore044 requested a review from a team as a code owner February 15, 2024 15:25
@damoore044
Copy link
Contributor Author

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

@damoore044 damoore044 added the Easy Fix :) Easiest Fix to review and quick merge request. label Feb 15, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5756
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_errata.py::test_end_to_end
Test Result : ================= 3 failed, 290 warnings in 2338.25s (0:38:58) =================

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 15, 2024
@damoore044
Copy link
Contributor Author

UI Failure navigating to [Details] in all parameters, this fixed the prior AssertionError before UI session,
locally testing the new failure.

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5761
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_errata.py::test_end_to_end
Test Result : ================= 3 failed, 294 warnings in 2357.91s (0:39:17) =================

@damoore044 damoore044 removed the 6.14.z Introduced in or relating directly to Satellite 6.14 label Feb 15, 2024
@damoore044
Copy link
Contributor Author

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

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5763
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_errata.py::test_end_to_end
Test Result : ================= 3 failed, 277 warnings in 2163.51s (0:36:03) =================

@damoore044 damoore044 force-pushed the e2e_errata_recalculate branch from c07c5cc to eaa2951 Compare February 16, 2024 14:48
@damoore044
Copy link
Contributor Author

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

@damoore044 damoore044 changed the title Recalculate errata before e2e UI session [E2E] Recalculate errata before UI session, fix navigation failure Feb 16, 2024
@damoore044 damoore044 changed the title [E2E] Recalculate errata before UI session, fix navigation failure [E2E] Recalculate applicability before UI session, fix navigation failure Feb 16, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5772
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_errata.py::test_end_to_end
Test Result : ================= 3 passed, 332 warnings in 2845.71s (0:47:25) =================

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Feb 16, 2024
@sambible sambible reopened this Feb 16, 2024
@sambible sambible force-pushed the e2e_errata_recalculate branch from eaa2951 to 6f93e0d Compare February 16, 2024 16:07
@damoore044 damoore044 removed the request for review from a team February 16, 2024 16:08
@Griffin-Sullivan Griffin-Sullivan merged commit 21ec37b into SatelliteQE:master Feb 16, 2024
6 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 16, 2024
…lure (#14095)

Recalculate applicability before session, fix nav failure.

(cherry picked from commit 21ec37b)
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
…lure (SatelliteQE#14095)

Recalculate applicability before session, fix nav failure.
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 CherryPick PR needs CherryPick to previous branches Easy Fix :) Easiest Fix to review and quick merge request. PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants