Skip to content

Commit

Permalink
Add read() method for BaseMultiSelect widget (#1006)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Gauravtalreja1 authored Oct 18, 2023
1 parent 9f20721 commit 2fc6f69
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 @@ -2479,6 +2479,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 @@ -2510,6 +2511,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 2fc6f69

Please sign in to comment.