Skip to content

Commit

Permalink
Merge pull request #15720 from ahmedhamidawan/related_filter_selenium…
Browse files Browse the repository at this point in the history
…_test

Add selenium test for history Related filter
  • Loading branch information
dannon authored Mar 15, 2023
2 parents 13e11db + e9ceffe commit 2fc6752
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</b-button>
<b-button
v-if="showHighlight"
class="px-1"
class="highlight-btn px-1"
title="Show Inputs for this item"
size="sm"
variant="link"
Expand Down
1 change: 1 addition & 0 deletions client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ history_panel:
# Action buttons...
download_button: '${_} .download-btn'
info_button: '${_} .params-btn'
highlight_button: '${_} .highlight-btn'
alltags: '${_} .stateless-tags .tag'
metadata_file_download: '${_} [data-description="download ${metadata_name}"]'

Expand Down
39 changes: 39 additions & 0 deletions lib/galaxy_test/selenium/test_history_related_filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from .framework import (
selenium_test,
SeleniumTestCase,
)

PASTED_CONTENT = "this is pasted"
CURRENT_HID = 1
RELATED_HID = 2
UNRELATED_HID = 3


class TestHistoryRelatedFilter(SeleniumTestCase):
@selenium_test
def test_history_related_filter(self):
self.register()
# upload (current) dataset to get related item for
self.perform_upload_of_pasted_content(PASTED_CONTENT)
self.history_panel_wait_for_hid_ok(CURRENT_HID)
# create related item through a tool
self.tool_open("cat")
self.tool_form_execute()
self.history_panel_wait_for_hid_ok(RELATED_HID)
# create an item unrelated to other items
self.perform_upload_of_pasted_content(PASTED_CONTENT)
self.history_panel_wait_for_hid_ok(UNRELATED_HID)

# test related filter on current item using button: only current and related items show
current_hda = self.history_panel_click_item_title(CURRENT_HID, wait=True)
current_hda.highlight_button.wait_for_and_click()
unrelated_hda = self.history_panel_item_component(hid=UNRELATED_HID)
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()
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()
filter_element.send_keys(f"related:{UNRELATED_HID}")
current_hda.wait_for_absent()

0 comments on commit 2fc6752

Please sign in to comment.