Skip to content

Commit f95b0a2

Browse files
Merge pull request #136 from splunk/bug-fix/update-single-select
Remove static build and avoid clicking dropdown again
2 parents a665578 + 272ca34 commit f95b0a2

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ commands:
2525
mkdir output
2626
cd output
2727
pwd
28-
# curl -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | grep "Splunk_TA.*tar.gz" | grep -v search_head | grep -v indexer | grep -v forwarder | cut -d : -f 2,3 | tr -d \" | wget -qi - || true
28+
curl -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | grep "Splunk_TA.*tar.gz" | grep -v search_head | grep -v indexer | grep -v forwarder | cut -d : -f 2,3 | tr -d \" | wget -qi - || true
2929
ls
30-
mv ../../Splunk_TA_UCCExample-8.0.1-R56b2ace.tar.gz ./
3130
tar -xzf *.tar.gz
3231
ls
3332
rm *.tar.gz

pytest_splunk_addon_ui_smartx/components/controls/single_select.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class SingleSelect(BaseControl):
1212
"""
1313
Entity-Component: SingleSelect
14-
Select Javascript framework: select2
14+
1515
A dropdown which can select only one value
1616
"""
1717
def __init__(self, browser, container, searchable=True, allow_new_values=False):
@@ -114,17 +114,19 @@ def search_get_list(self, value):
114114
searched_values = list(self._list_visible_values())
115115
else:
116116
self.wait_for_search_list()
117-
searched_values = list(self._list_visible_values())
117+
searched_values = list(self._list_visible_values(open_dropdown=False))
118118
self.input.send_keys(Keys.ESCAPE)
119119
self.wait_for("container")
120120
return searched_values
121121

122-
def _list_visible_values(self):
122+
def _list_visible_values(self, open_dropdown=True):
123123
"""
124124
Gets list of values which are visible. Used while filtering
125+
:param open_dropdown: Whether or not the dropdown should be opened
125126
:returns: List of the values that are visible
126127
"""
127-
self.dropdown.click()
128+
if open_dropdown:
129+
self.dropdown.click()
128130
if self.allow_new_values:
129131
popoverid = '#' + self.combobox.get_attribute("data-test-popover-id")
130132
self.elements.update({
@@ -286,7 +288,7 @@ def wait_for_search_list(self):
286288
Wait for SingleSelect search to populate
287289
"""
288290
def _wait_for_search_list(driver):
289-
return len(list(self._list_visible_values())) > 0
291+
return len(list(self._list_visible_values(open_dropdown=False))) > 0
290292
self.wait_for(_wait_for_search_list, msg="No values found in SingleSelect search")
291293

292294
def is_editable(self):
-3.37 MB
Binary file not shown.

0 commit comments

Comments
 (0)