Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: singleselect is_editable() #404

Merged
merged 7 commits into from
Nov 15, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -348,27 +348,9 @@ def _wait_for_search_list(driver):
_wait_for_search_list, msg="No values found in SingleSelect search"
)

def is_editable(self):
def is_editable(self) -> bool:
vtsvetkov-splunk marked this conversation as resolved.
Show resolved Hide resolved
"""
Returns True if the Textbox is editable, False otherwise
Returns True if the SingleSelect is editable, False otherwise
"""
if self.searchable:
if self.allow_new_values:
self.elements.update(
{
"input": Selector(
select=self.container.select + ' [data-test="textbox"]'
)
}
)
else:
self.root.click()
popover_id = "#" + self.root.get_attribute("data-test-popover-id")
self.elements.update(
{"input": Selector(select=popover_id + ' [data-test="textbox"]')}
)
return not bool(
self.input.get_attribute("readonly")
or self.input.get_attribute("readOnly")
or self.input.get_attribute("disabled")
)
self.get_element("root")
return True if self.allow_new_values else False
15 changes: 15 additions & 0 deletions tests/ui/test_splunk_ta_example_addon_input_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,3 +1351,18 @@ def test_inputs_textarea_scroll(
input_page.entity1.text_area.scroll("UP", 40)
screenshot_after = input_page.entity1.text_area.screenshot()
self.assert_util(screnshot_before, screenshot_after, operator="!=")

@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_single_select_is_editable(
self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
"""
Verifies that SingleSelect value is editable or not
"""
input_page = InputPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
input_page.create_new_input.select("Example Input One")
self.assert_util(input_page.entity1.single_select_group_test.is_editable, True)
self.assert_util(input_page.entity1.index.is_editable, True)
self.assert_util(input_page.entity1.example_account.is_editable, False)
Loading