From c40df7248c1f70597d9315ba6db86efd74a21718 Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Thu, 26 Oct 2023 07:26:04 -0400 Subject: [PATCH] Add read() method for BaseMultiSelect widget (#1006) (#1007) Signed-off-by: Gaurav Talreja (cherry picked from commit 2fc6f69dfb7cfbb50eb433c2b8c3155c067c4c3e) Co-authored-by: Gaurav Talreja --- airgun/widgets.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/airgun/widgets.py b/airgun/widgets.py index fc828e14f..7378ef7ec 100644 --- a/airgun/widgets.py +++ b/airgun/widgets.py @@ -2405,6 +2405,7 @@ class BaseMultiSelect(BaseSelect, Dropdown): BUTTON_LOCATOR = './/button[@aria-label="Options menu"]' OUIA_COMPONENT_TYPE = "PF4/Select" + SELECTED_ITEMS_LIST = './/div[@class="pf-c-chip-group"]' def item_select(self, items, close=True): """Opens the Dropdown and selects the desired items. @@ -2436,6 +2437,12 @@ def fill(self, items): finally: self.close() + def read(self): + try: + return self.browser.text(self.SELECTED_ITEMS_LIST).split(' ') + except NoSuchElementException: + return None + class InventoryBootstrapSwitch(Widget): """Checkbox-like Switch control, representing On and Off state. But with