Add basic selenium test for shared histories

This commit is contained in:
davelopez
2023-02-09 09:11:25 +01:00
parent 6baae3411b
commit ecdc31b52e
3 changed files with 21 additions and 0 deletions
@@ -64,6 +64,7 @@ masthead:
histories: 'Histories'
invocations: 'Workflow Invocations'
pages: 'Pages'
histories_shared_with_me: 'Histories shared with me'
# Shared data
libraries: 'Data Libraries'
@@ -366,6 +367,11 @@ published_histories:
tag_content: '#published-histories-table tbody tr .ti-tag .tag-name'
column_header: '#published-histories-table thead tr th:nth-child(${column_number})'
shared_histories:
selectors:
_: ".histories-shared-with-you-by-others"
histories: "#grid-table-body tr"
history_copy_elements:
selectors:
# Following two don't really work as CSS would only work as jQuery/sizzle I think
+5
View File
@@ -1055,6 +1055,11 @@ class NavigatesGalaxy(HasDriver):
self.click_masthead_user()
self.components.masthead.histories.wait_for_and_click()
def navigate_to_histories_shared_with_me_page(self):
self.home()
self.click_masthead_user()
self.components.masthead.histories_shared_with_me.wait_for_and_click()
def navigate_to_user_preferences(self):
self.home()
self.click_masthead_user()
@@ -73,6 +73,16 @@ class TestHistorySharing(SeleniumTestCase):
self.assert_error_message(contains="You cannot share resources with yourself")
self.screenshot("history_sharing_invalid_with_self")
@selenium_test
def test_shared_with_me(self):
user1_email, user2_email, history_id = self.setup_two_users_with_one_shared_history()
self.submit_login(user2_email, retries=VALID_LOGIN_RETRIES)
self.navigate_to_histories_shared_with_me_page()
self.components.shared_histories.selector.wait_for_present()
rows = self.components.shared_histories.histories.all()
assert len(rows) > 0
assert any(user1_email in row.text for row in rows)
def setup_two_users_with_one_shared_history(self, share_by_id=False):
user1_email = self._get_random_email()
user2_email = self._get_random_email()