diff --git a/client/src/components/Common/FilterMenu.vue b/client/src/components/Common/FilterMenu.vue index 477cf789c1c9..90e5889f19d7 100644 --- a/client/src/components/Common/FilterMenu.vue +++ b/client/src/components/Common/FilterMenu.vue @@ -322,7 +322,7 @@ watch( Filter by {{ validFilters[filter]?.placeholder }}: - + tbody > tr:not(.b-table-empty-row, [style*='display: none'])" external_link: '.workflow-external-link' diff --git a/config/plugins/tours/core.history.yaml b/config/plugins/tours/core.history.yaml index a7ab5c393f1b..d0c1ecce2f54 100644 --- a/config/plugins/tours/core.history.yaml +++ b/config/plugins/tours/core.history.yaml @@ -71,7 +71,7 @@ steps: intro: "You can remove a dataset from the history with the trash can symbol." postclick: true - - element: "#current-history-panel input[data-description='filter text input']" + - element: "#current-history-panel .content-operations-filters input[data-description='filter text input']" title: "Filter your datasets" intro: "By default your history will hide all deleted datasets from you. You can visualize them by filtering." textinsert: "deleted:true" @@ -83,7 +83,7 @@ steps: Please note that datasets marked as deleted can be purged by your administrator at any time. postclick: true - - element: "#current-history-panel [data-description='filter text input']" + - element: "#current-history-panel .content-operations-filters input[data-description='filter text input']" title: "Search your History" intro: "You can filter your history by typing your search term in here. Galaxy supports more advanced filters that can be seen here." textinsert: "" diff --git a/lib/galaxy/selenium/navigates_galaxy.py b/lib/galaxy/selenium/navigates_galaxy.py index 571f6c1db772..cb8b939d004a 100644 --- a/lib/galaxy/selenium/navigates_galaxy.py +++ b/lib/galaxy/selenium/navigates_galaxy.py @@ -17,6 +17,7 @@ Any, cast, Dict, + List, NamedTuple, Optional, Union, @@ -1380,7 +1381,13 @@ def workflow_index_column_text(self, column_index, workflow_index=0): return columns[column_index].text def workflow_index_click_search(self): - return self.wait_for_and_click_selector('[data-description="filter text input"]') + return self.wait_for_and_click_selector( + '.workflows-list input.search-query[data-description="filter text input"]' + ) + + def workflow_index_get_current_filter(self): + filter_element = self.components.workflows.search_box.wait_for_and_click() + return filter_element.get_attribute("value") def workflow_index_search_for(self, search_term=None): return self._inline_search_for( @@ -1389,6 +1396,14 @@ def workflow_index_search_for(self, search_term=None): escape_to_clear=True, ) + def workflow_index_add_advanced_tag_filter(self, tags: List[str]): + for tag in tags: + tag_display = self.components.workflows.advanced_search_tag_input + if tag_display.is_absent: + self.components.workflows.advanced_search_toggle.wait_for_and_click() + tag_display.wait_for_and_click() + self.tagging_add([tag]) + def workflow_index_click_import(self): return self.components.workflows.import_button.wait_for_and_click() diff --git a/lib/galaxy_test/selenium/test_collection_builders.py b/lib/galaxy_test/selenium/test_collection_builders.py index 40de27bab006..bf2265e72e21 100644 --- a/lib/galaxy_test/selenium/test_collection_builders.py +++ b/lib/galaxy_test/selenium/test_collection_builders.py @@ -126,6 +126,8 @@ def _wait_for_and_select(self, hids): def _show_hidden_content(self): """Switches the hidden filter toggle on""" self.sleep_for(self.wait_types.UX_RENDER) - filter_element = self.history_element("filter text input").wait_for_and_click() + filter_element = self.history_element( + attribute_value="filter text input", scope=".content-operations-filters" + ).wait_for_and_click() filter_element.send_keys("visible:false") self.sleep_for(self.wait_types.UX_RENDER) diff --git a/lib/galaxy_test/selenium/test_history_related_filter.py b/lib/galaxy_test/selenium/test_history_related_filter.py index e167e9801d57..d61482cc57e2 100644 --- a/lib/galaxy_test/selenium/test_history_related_filter.py +++ b/lib/galaxy_test/selenium/test_history_related_filter.py @@ -31,7 +31,9 @@ def test_history_related_filter(self): unrelated_hda.assert_absent_or_hidden() # test related filter on unrelated item using filterText: only unrelated item shows - filter_element = self.history_element("filter text input").wait_for_and_click() + filter_element = self.history_element( + attribute_value="filter text input", scope=".content-operations-filters" + ).wait_for_and_click() initial_value = filter_element.get_attribute("value") assert initial_value == f"related:{CURRENT_HID}", initial_value self.history_element("clear filters").wait_for_and_click() diff --git a/lib/galaxy_test/selenium/test_workflow_management.py b/lib/galaxy_test/selenium/test_workflow_management.py index 68cf13354990..ffb6ac8e12a3 100644 --- a/lib/galaxy_test/selenium/test_workflow_management.py +++ b/lib/galaxy_test/selenium/test_workflow_management.py @@ -181,6 +181,34 @@ def test_index_search_filters(self): self._assert_showing_n_workflows(0) self.screenshot("workflow_manage_search_name_alias") + @selenium_test + def test_index_advanced_search(self): + self.workflow_index_open() + self._workflow_import_from_url() + self.workflow_index_rename("searchforthis") + self._assert_showing_n_workflows(1) + + self.workflow_index_add_tag("mytag") + self.components.workflows.advanced_search_toggle.wait_for_and_click() + # search by tag and name + self.components.workflows.advanced_search_name_input.wait_for_and_send_keys("searchforthis") + self.workflow_index_add_advanced_tag_filter(["mytag"]) + self._assert_showing_n_workflows(1) + curr_value = self.workflow_index_get_current_filter() + assert curr_value == f"name:searchforthis tag:mytag", curr_value + + # clear filter + self.components.workflows.clear_filter.wait_for_and_click() + curr_value = self.workflow_index_get_current_filter() + assert curr_value == f"", curr_value + + self.components.workflows.advanced_search_toggle.wait_for_and_click() + # search by 2 tags, one of which is not present + self.workflow_index_add_advanced_tag_filter(["mytag", "DNEtag"]) + curr_value = self.workflow_index_get_current_filter() + assert curr_value == f"tag:mytag tag:DNEtag", curr_value + self._assert_showing_n_workflows(0) + @selenium_test def test_workflow_delete(self): self.workflow_index_open()