From d0da7e75e0fd8727082ddad431738f48eef63d6e Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:51:57 +0100 Subject: [PATCH] fix parameters inputs function --- client/src/components/Panels/InputPanel.vue | 7 +++--- .../Workflow/Editor/modules/inputs.ts | 24 ++++++++++++------- client/src/utils/navigation/navigation.yml | 5 ++++ lib/galaxy/selenium/navigates_galaxy.py | 9 ++++--- .../selenium/test_workflow_editor.py | 8 +++---- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/client/src/components/Panels/InputPanel.vue b/client/src/components/Panels/InputPanel.vue index f62dd45e5bf3..2150d969050a 100644 --- a/client/src/components/Panels/InputPanel.vue +++ b/client/src/components/Panels/InputPanel.vue @@ -20,11 +20,12 @@ const emit = defineEmits<{ diff --git a/client/src/components/Workflow/Editor/modules/inputs.ts b/client/src/components/Workflow/Editor/modules/inputs.ts index 1e299c4a5bd4..c152058d4360 100644 --- a/client/src/components/Workflow/Editor/modules/inputs.ts +++ b/client/src/components/Workflow/Editor/modules/inputs.ts @@ -3,7 +3,8 @@ import { faPencilAlt } from "@fortawesome/free-solid-svg-icons"; import { type IconDefinition } from "font-awesome-6"; export interface WorkflowInput { - id: string; + id?: string; // unique ID. defaults to module ID + moduleId: string; title: string; description: string; stateOverwrites?: { @@ -15,19 +16,19 @@ export interface WorkflowInput { export function getWorkflowInputs(): WorkflowInput[] { return [ { - id: "data_input", + moduleId: "data_input", title: "Input Dataset", description: "Single dataset input", icon: faFile, }, { - id: "data_collection_input", + moduleId: "data_collection_input", title: "Input Dataset Collection", description: "Input for a collection of datasets", icon: faFolder, }, { - id: "parameter_input", + moduleId: "parameter_input", title: "Text Input", description: "Text parameter used for workflow logic", icon: faPencilAlt, @@ -36,7 +37,8 @@ export function getWorkflowInputs(): WorkflowInput[] { }, }, { - id: "parameter_input", + id: "parameter_input_integer", + moduleId: "parameter_input", title: "Integer Input", description: "Whole number parameter used for workflow logic", icon: faPencilAlt, @@ -45,7 +47,8 @@ export function getWorkflowInputs(): WorkflowInput[] { }, }, { - id: "parameter_input", + id: "parameter_input_float", + moduleId: "parameter_input", title: "Float Input", description: "Imprecise decimal number parameter used for workflow logic", icon: faPencilAlt, @@ -54,7 +57,8 @@ export function getWorkflowInputs(): WorkflowInput[] { }, }, { - id: "parameter_input", + id: "parameter_input_boolean", + moduleId: "parameter_input", title: "Boolean Input", description: "True / False parameter used for workflow logic", icon: faPencilAlt, @@ -63,7 +67,8 @@ export function getWorkflowInputs(): WorkflowInput[] { }, }, { - id: "parameter_input", + id: "parameter_input_color", + moduleId: "parameter_input", title: "Color Input", description: "Color parameter used for workflow logic", icon: faPencilAlt, @@ -72,7 +77,8 @@ export function getWorkflowInputs(): WorkflowInput[] { }, }, { - id: "parameter_input", + id: "parameter_input_directory_uri", + moduleId: "parameter_input", title: "Directory Input", description: "Directory parameter used for workflow logic", icon: faPencilAlt, diff --git a/client/src/utils/navigation/navigation.yml b/client/src/utils/navigation/navigation.yml index 0612bdf75aff..a20d2d82ecac 100644 --- a/client/src/utils/navigation/navigation.yml +++ b/client/src/utils/navigation/navigation.yml @@ -750,6 +750,11 @@ workflow_editor: freehand_comment: ".freehand-workflow-comment" freehand_path: ".freehand-workflow-comment path" delete: "button[title='Delete comment']" + inputs: + selectors: + activity_button: "#activity-workflow-editor-inputs" + activity_panel: ".activity-panel[data-description='Inputs']" + input: ".workflow-input-button[data-id='${id}']" selectors: node_inspector: '.tool-inspector' node_inspector_close: ".tool-inspector [title='close']" diff --git a/lib/galaxy/selenium/navigates_galaxy.py b/lib/galaxy/selenium/navigates_galaxy.py index 141d6e1c28ec..10abaf0ed8d5 100644 --- a/lib/galaxy/selenium/navigates_galaxy.py +++ b/lib/galaxy/selenium/navigates_galaxy.py @@ -1209,12 +1209,11 @@ def workflow_editor_add_input(self, item_name="data_input"): # Make sure we're on the workflow editor and not clicking the main tool panel. editor.canvas_body.wait_for_visible() - self.open_toolbox() - editor.tool_menu_section_link(section_name="inputs").wait_for_and_click() - editor.tool_menu_item_link(item_name=item_name).wait_for_and_click() + if editor.inputs.activity_panel.is_absent: + editor.inputs.activity_button.wait_for_and_click() - def workflow_editor_add_parameter_input(self): - self.workflow_editor_add_input(item_name="parameter_input") + editor.inputs.input(id=item_name).wait_for_and_click() + self.sleep_for(self.wait_types.UX_RENDER) def workflow_editor_set_license(self, license: str) -> None: license_selector = self.components.workflow_editor.license_selector diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index 229b76634b36..8ad6d81a606f 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -102,7 +102,7 @@ def test_parameter_regex_validation(self): parameter_name = "text_param" name = self.create_and_wait_for_new_workflow_in_editor() - self.workflow_editor_add_parameter_input() + self.workflow_editor_add_input("parameter_input_text") editor.label_input.wait_for_and_send_keys(parameter_name) # this really should be parameterized with the repeat name self.components.tool_form.repeat_insert.wait_for_and_click() @@ -131,7 +131,7 @@ def test_int_parameter_minimum_validation(self): parameter_name = "int_param" name = self.create_and_wait_for_new_workflow_in_editor() - self.workflow_editor_add_parameter_input() + self.workflow_editor_add_input("parameter_input_text") editor.label_input.wait_for_and_send_keys(parameter_name) select_field = self.components.tool_form.parameter_select(parameter="parameter_definition|parameter_type") self.select_set_value(select_field, "integer") @@ -157,10 +157,8 @@ def test_float_parameter_maximum_validation(self): parameter_name = "float_param" name = self.create_and_wait_for_new_workflow_in_editor() - self.workflow_editor_add_parameter_input() + self.workflow_editor_add_input("parameter_input_float") editor.label_input.wait_for_and_send_keys(parameter_name) - select_field = self.components.tool_form.parameter_select(parameter="parameter_definition|parameter_type") - self.select_set_value(select_field, "float") self.components.tool_form.parameter_input(parameter="parameter_definition|max").wait_for_and_send_keys("3.14") self.save_after_node_form_changes()