-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15720 from ahmedhamidawan/related_filter_selenium…
…_test Add selenium test for history Related filter
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |