fix Selenium and Integration Selenium tests

This commit is contained in:
Alireza Heidari
2024-02-16 12:02:49 +01:00
parent 362fe07467
commit 4c4e83a1d5
6 changed files with 19 additions and 23 deletions
@@ -104,7 +104,7 @@ function updateFilter(newVal: string) {
}
function onTagClick(tag: string) {
filterText.value = WorkflowFilters.setFilterValue(filterText.value, "tag", tag);
filterText.value = WorkflowFilters.setFilterValue(filterText.value, "tag", `'${tag}'`);
}
async function load(overlayLoading = false, silentLoading = false) {
+2 -1
View File
@@ -598,7 +598,8 @@ workflows:
advanced_search_submit: '#workflows-advanced-filter-submit'
workflow_rows: "#workflow-table > tbody > tr:not(.b-table-empty-row, [style*='display: none'])"
workflows_list: '#workflows-list'
workflow_card: '[data-workflow-id]'
workflow_not_found_message: '#no-workflow-found'
workflow_card: '.workflow-card'
workflow_cards: '#workflow-cards'
external_link: '.workflow-external-link'
trs_icon: '.workflow-trs-icon'
+4 -12
View File
@@ -1401,24 +1401,16 @@ class NavigatesGalaxy(HasDriver):
self.workflow_index_open()
self.components.workflows.shared_with_me_tab.wait_for_and_click()
def workflow_index_table_elements(self):
workflows = self.components.workflows
workflows.workflow_table.wait_for_visible()
return workflows.workflow_rows.all()
def workflow_card_elements(self):
self.components.workflows.workflow_cards.wait_for_visible()
return self.components.workflows.workflow_card.all()
def workflow_card_element(self, workflow_index=0):
return self.workflow_card_elements()[workflow_index]
def workflow_index_table_row(self, workflow_index=0):
self.components.workflows.workflow_rows.wait_for_element_count_of_at_least(workflow_index + 1)
return self.workflow_index_table_elements()[workflow_index]
@retry_during_transitions
def workflow_index_column_text(self, column_index, workflow_index=0):
row_element = self.workflow_index_table_row(workflow_index=workflow_index)
row_element = self.workflow_card_element(workflow_index=workflow_index)
columns = row_element.find_elements(By.CSS_SELECTOR, "td")
return columns[column_index].text
@@ -1468,7 +1460,7 @@ class NavigatesGalaxy(HasDriver):
@retry_during_transitions
def workflow_click_option(self, workflow_selector, workflow_index=0):
workflow_row = self.workflow_index_table_row(workflow_index=workflow_index)
workflow_row = self.workflow_card_element(workflow_index=workflow_index)
workflow_button = workflow_row.find_element(By.CSS_SELECTOR, workflow_selector)
workflow_button.click()
@@ -1510,7 +1502,7 @@ class NavigatesGalaxy(HasDriver):
@retry_during_transitions
def workflow_index_tag_elements(self, workflow_index=0):
workflow_row_element = self.workflow_index_table_row(workflow_index)
workflow_row_element = self.workflow_card_element(workflow_index)
tag_display = workflow_row_element.find_element(By.CSS_SELECTOR, ".stateless-tags")
tag_spans = tag_display.find_elements(By.CSS_SELECTOR, ".tag")
return tag_spans
@@ -18,11 +18,11 @@ class TestWorkflowManagement(SeleniumTestCase, TestsGalaxyPagers, UsesWorkflowAs
self.workflow_index_open()
self._workflow_import_from_url()
table_elements = self.workflow_index_table_elements()
assert len(table_elements) == 1
workflow_cards = self.workflow_card_elements()
assert len(workflow_cards) == 1
new_workflow = table_elements[0].find_element(By.CSS_SELECTOR, ".workflow-dropdown")
assert "TestWorkflow1 (imported from URL)" in new_workflow.text, new_workflow.text
first_workflow_card = workflow_cards[0].find_element(By.CSS_SELECTOR, ".workflow-name")
assert "TestWorkflow1 (imported from URL)" in first_workflow_card.text, first_workflow_card.text
@selenium_test
def test_import_accessibility(self):
@@ -102,16 +102,19 @@ class TestWorkflowManagement(SeleniumTestCase, TestsGalaxyPagers, UsesWorkflowAs
self._workflow_import_from_url()
self.workflow_index_add_tag("mytag")
self._workflow_import_from_url()
self.workflow_index_open()
self.workflow_index_add_tag("mytag")
self._workflow_import_from_url()
self.workflow_index_open()
self.workflow_index_add_tag("mytaglonger")
self._workflow_import_from_url()
self.workflow_index_open()
self.workflow_index_search_for("mytag")
self._assert_showing_n_workflows(3)
self.screenshot("workflow_manage_search_by_tag_freetext")
self.workflow_index_search_for("thisisnotatag")
self._assert_showing_n_workflows(0)
self.components.workflows.workflow_not_found_message.wait_for_visible()
self.workflow_index_search_for()
self._assert_showing_n_workflows(4)
+2 -2
View File
@@ -50,7 +50,7 @@ class TestTrsImport(SeleniumIntegrationTestCase):
def assert_workflow_imported(self, name):
self.workflow_index_search_for(name)
assert len(self.workflow_index_table_elements()) == 1, f"workflow ${name} not imported"
assert len(self.workflow_card_elements()) == 1, f"workflow ${name} not imported"
def test_import_workflow_by_url_dockstore(self):
import_url = f"workflows/trs_import?trs_server=dockstore.org&trs_version={TRS_VERSION_DOCKSTORE}&trs_id=%23{TRS_ID_DOCKSTORE}"
@@ -63,7 +63,7 @@ class TestTrsImport(SeleniumIntegrationTestCase):
def _import_workflow_by_url(self, import_url):
full_url = self.build_url(import_url)
self.driver.get(full_url)
self.components.workflows.workflow_table.wait_for_visible()
self.components.workflows.workflow_cards.wait_for_visible()
self.assert_workflow_imported(WORKFLOW_NAME)
def test_import_by_search_dockstore(self):
@@ -36,7 +36,7 @@ steps:
exact_tools=True,
)
self.workflow_index_open()
self.workflow_index_click_option("Edit")
self.components.workflows.edit_button.wait_for_and_click()
editor = self.components.workflow_editor
editor.node._(label="compose_text_param").wait_for_and_click()
editor.tool_version_button.wait_for_and_click()
@@ -65,7 +65,7 @@ steps:
"""
)
self.workflow_index_open()
self.workflow_index_click_option("Edit")
self.components.workflows.edit_button.wait_for_and_click()
self.assert_modal_has_text("Using version '0.1.1' instead of version '0.0.0'")
self.screenshot("workflow_editor_tool_repository_upgrade")
self.components.workflow_editor.modal_button_continue.wait_for_and_click()