diff --git a/src/widgetastic_patternfly5/components/chip.py b/src/widgetastic_patternfly5/components/chip.py index b9ee1ea..c250623 100644 --- a/src/widgetastic_patternfly5/components/chip.py +++ b/src/widgetastic_patternfly5/components/chip.py @@ -14,7 +14,10 @@ def __init__(self, chip, message): self.chip = chip -CHIP_ROOT = ".//div[contains(@class, '-c-chip') and not(contains(@class, '-m-overflow'))]" +CHIP_ROOT = ( + ".//div[contains(@class, '-c-chip') and not(contains(@class, '-m-overflow')) " + "and not(contains(@class, '-c-chip-group'))]" +) CHIP_TEXT = ".//span[contains(@class, '-c-chip__text')]" CHIP_BADGE = ".//span[contains(@class, '-c-badge')]" GROUP_ROOT = ".//div[contains(@class, '-c-chip-group__main')]" diff --git a/testing/components/test_chip.py b/testing/components/test_chip.py index 0377dce..f8a3077 100644 --- a/testing/components/test_chip.py +++ b/testing/components/test_chip.py @@ -63,6 +63,9 @@ def test_chipgroup_category(category_chip_group_view): assert category_chip_group_view.category_one.is_displayed assert category_chip_group_view.category_one.label == "Category one" + chips = ["Chip one", "Chip two", "Chip three"] + assert category_chip_group_view.category_one.read() == chips + category_chip_group_view.category_one.close() assert not category_chip_group_view.category_one.is_displayed