Skip to content

Commit

Permalink
Add selenium test for history Related filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Mar 6, 2023
1 parent b855f39 commit 952d29d
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 @@ -200,6 +200,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.assert_absent_or_hidden()

0 comments on commit 952d29d

Please sign in to comment.