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

Fix clean button locator in PF4 search. #965

Merged

Conversation

lhellebr
Copy link
Contributor

As it was, we were getting an error when searching for the element, getting False for is_displayed. Consequently, the clear button was not clicked and a generic browser clear was called instead. The text disappeared for a bit and then it got re-filled to the search field.
It caused failures in tests such as
tests/foreman/ui/test_dashboard.py::test_positive_task_status
Changing type and locator fixes the issue.

As it was, we were getting an error when searching for the element,
getting False for is_displayed. Consequently, the clear button was
not clicked and a generic browser clear was called instead.
The text disappeared for a bit and then it got re-filled to the
search field.
It caused failures in tests such as
tests/foreman/ui/test_dashboard.py::test_positive_task_status
Changing type and locator fixes the issue.
@lhellebr lhellebr added CherryPick PR needs CherryPick to previous branches 6.14.z labels Sep 11, 2023
@lhellebr
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_dashboard.py::test_positive_task_status tests/foreman/ui/test_contentview.py::test_positive_end_to_end tests/foreman/ui/test_media.py::test_positive_end_to_end

@lhellebr
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_dashboard.py::test_positive_task_status tests/foreman/ui/test_contentview.py::test_positive_add_rh_content tests/foreman/ui/test_media.py::test_positive_end_to_end

@lhellebr
Copy link
Contributor Author

Cause of failure unrelated, it also fails in snap automation:

>           raise NoSuchElementException(f"Could not find an element {repr(locator)}") from None
E           selenium.common.exceptions.NoSuchElementException: Message: Could not find an element Locator(by='xpath', locator="//a[contains(@href, '/content_views/new')]"); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception

Rerunning without the offending test.

@lhellebr
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_dashboard.py::test_positive_task_status tests/foreman/ui/test_media.py::test_positive_end_to_end

@lhellebr
Copy link
Contributor Author

The failures in PRT don't seem related. They only fail in master, not 6.14.z, and the same failure happens in master when I revert my commit.

I wanted to use PRT to check whether I cause regression or not but in the end, I ran on 6.14.z branch (with this commit cherrypicked) locally:

$ pytest tests/foreman/ui/test_dashboard.py::test_positive_task_status  tests/foreman/ui/test_media.py::test_positive_end_to_end
[...]
========================================= 2 passed, 6 warnings in 211.27s (0:03:31) ==========================================

There are many navigation related issues in Stream so I think this is merge worthy as it is. Alternatively, we can only merge into 6.14.z (that means future work).

@lhellebr lhellebr requested a review from a team September 11, 2023 17:39
@Gauravtalreja1 Gauravtalreja1 added the AutoMerge_Cherry_Picked Automatically merge the PR is PRT and all checks are passing label Sep 12, 2023
@adarshdubey-star
Copy link
Contributor

Do we need it in older satellite versions as well @lhellebr?

@lhellebr
Copy link
Contributor Author

In 6.13.z branch, the locator is clear_button = Text(locator=(".//button[contains(@class,'autocomplete-clear-button')]")) - different enough for me to consider it a different issue (if it even is an issue).

@omkarkhatavkar omkarkhatavkar merged commit 80b7eb9 into SatelliteQE:master Sep 14, 2023
14 of 15 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 14, 2023
As it was, we were getting an error when searching for the element,
getting False for is_displayed. Consequently, the clear button was
not clicked and a generic browser clear was called instead.
The text disappeared for a bit and then it got re-filled to the
search field.
It caused failures in tests such as
tests/foreman/ui/test_dashboard.py::test_positive_task_status
Changing type and locator fixes the issue.

(cherry picked from commit 80b7eb9)
omkarkhatavkar pushed a commit that referenced this pull request Sep 15, 2023
As it was, we were getting an error when searching for the element,
getting False for is_displayed. Consequently, the clear button was
not clicked and a generic browser clear was called instead.
The text disappeared for a bit and then it got re-filled to the
search field.
It caused failures in tests such as
tests/foreman/ui/test_dashboard.py::test_positive_task_status
Changing type and locator fixes the issue.

(cherry picked from commit 80b7eb9)

Co-authored-by: Lukáš Hellebrandt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z AutoMerge_Cherry_Picked Automatically merge the PR is PRT and all checks are passing CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants