Skip to content

Commit

Permalink
Fix clean button locator in PF4 search. (#965)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lhellebr authored Sep 14, 2023
1 parent de9f309 commit 80b7eb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airgun/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ class PF4Search(Search):
ROOT = '//div[@class="foreman-search-bar"]'
search_field = TextInput(locator=(".//input[@aria-label='Search input']"))
search_button = Text(locator=(".//button[@aria-label='Search']"))
clear_button = Button(locator=(".//input[@aria-label='Reset search']"))
clear_button = Text(locator=(".//button[@aria-label='Reset search']"))

def clear(self):
"""Clears search field value and re-trigger search to remove all
Expand Down

0 comments on commit 80b7eb9

Please sign in to comment.