Skip to content

Commit

Permalink
Add read() method for BaseMultiSelect widget (#1006) (#1007)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Talreja <[email protected]>
(cherry picked from commit 2fc6f69)

Co-authored-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Satellite-QE and Gauravtalreja1 authored Oct 26, 2023
1 parent c6c9178 commit c40df72
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions airgun/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c40df72

Please sign in to comment.