Skip to content

Commit

Permalink
Select: Make button locator more speciffic
Browse files Browse the repository at this point in the history
When there is an item selected it would click on the clear button
instead of the toggle button when trying to access items or calling
open(), this fixes that.
  • Loading branch information
jrusz committed Feb 20, 2024
1 parent 58fa739 commit 39db0e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/widgetastic_patternfly5/components/menus/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ class BaseSelect:
https://www.patternfly.org/components/menus/select
"""

BUTTON_LOCATOR = ".//button"
BUTTON_LOCATOR = (
".//button[(contains(@class, '-c-select__toggle') "
"or contains(@class, '-c-menu-toggle')) "
"and not(contains(@class, '-c-select__toggle-clear'))]"
)
ITEMS_LOCATOR = (
".//ul[contains(@class, '-c-menu__list') or contains(@class, '-c-select__menu')]/"
"li[contains(@class, '-c-menu__list-item') or contains(@class, '-c-select__menu-wrapper')]"
Expand Down

0 comments on commit 39db0e4

Please sign in to comment.