diff --git a/pytest_splunk_addon_ui_smartx/components/controls/single_select.py b/pytest_splunk_addon_ui_smartx/components/controls/single_select.py index 6b46a1b5..196c2a74 100644 --- a/pytest_splunk_addon_ui_smartx/components/controls/single_select.py +++ b/pytest_splunk_addon_ui_smartx/components/controls/single_select.py @@ -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: """ - 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 diff --git a/tests/ui/test_splunk_ta_example_addon_input_1.py b/tests/ui/test_splunk_ta_example_addon_input_1.py index bd52605c..43c9ecd3 100644 --- a/tests/ui/test_splunk_ta_example_addon_input_1.py +++ b/tests/ui/test_splunk_ta_example_addon_input_1.py @@ -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)