From 15ded641b039e376164dbb80a681ab49869faa94 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 18 Nov 2020 16:25:05 +0100 Subject: [PATCH 01/13] Debounce workflow annotation This fixes the flaky selenium tests that check for the `my cool annotation` annotation. --- client/src/components/Workflow/Editor/Attributes.vue | 12 ++++++++++-- lib/galaxy_test/selenium/test_workflow_editor.py | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client/src/components/Workflow/Editor/Attributes.vue b/client/src/components/Workflow/Editor/Attributes.vue index c36c650c999..940129fbebd 100644 --- a/client/src/components/Workflow/Editor/Attributes.vue +++ b/client/src/components/Workflow/Editor/Attributes.vue @@ -27,7 +27,7 @@
Annotation - +
These notes will be visible when this workflow is viewed.
@@ -165,7 +165,12 @@ export default { this.onAttributes({ tags }); }, onAnnotation(annotation) { - this.onAttributes({ annotation }); + if (this.annotationTimeout) { + clearTimeout(this.annotationTimeout); + } + this.annotationTimeout = setTimeout(() => { + this.onAttributes({ annotation }); + }, 300); }, onRename(name) { this.onAttributes({ name }); @@ -193,6 +198,9 @@ export default { this.onError(error); }); }, + beforeDestroy: function () { + clearTimeout(this.annotationTimeout); + }, }, }; diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index 595f394207a..190dc92c98a 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -75,7 +75,7 @@ class WorkflowEditorTestCase(SeleniumTestCase): label = editor.label_input.wait_for_value() assert label == "input1", label annotation = editor.annotation_input.wait_for_value() - assert annotation == "my cool annotation" + assert annotation == "my cool annotation", annotation data_input_node.destroy.wait_for_and_click() data_input_node.wait_for_absent() self.screenshot("workflow_editor_data_input_deleted") @@ -100,7 +100,7 @@ class WorkflowEditorTestCase(SeleniumTestCase): label = editor.label_input.wait_for_value() assert label == "input1", label annotation = editor.annotation_input.wait_for_value() - assert annotation == "my cool annotation" + assert annotation == "my cool annotation", annotation data_input_node.destroy.wait_for_and_click() data_input_node.wait_for_absent() self.sleep_for(self.wait_types.UX_RENDER) @@ -126,7 +126,7 @@ class WorkflowEditorTestCase(SeleniumTestCase): label = editor.label_input.wait_for_value() assert label == "input1", label annotation = editor.annotation_input.wait_for_value() - assert annotation == "my cool annotation" + assert annotation == "my cool annotation", annotation data_input_node.destroy.wait_for_and_click() data_input_node.wait_for_absent() self.sleep_for(self.wait_types.UX_RENDER) From e78a0a253fcfe4a2bede8bce44414d51f75ed4c8 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 20 Nov 2020 17:00:16 +0100 Subject: [PATCH 02/13] Silence SAWarning Silences ``` Got None for value of column workflow_step.id; this is unsupported for a relationship comparison and will not currently produce an IS comparison (but may in a future release) "(but may in a future release)" % column ``` --- lib/galaxy/model/item_attrs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/model/item_attrs.py b/lib/galaxy/model/item_attrs.py index 72352fc0f66..9ce45f8d259 100644 --- a/lib/galaxy/model/item_attrs.py +++ b/lib/galaxy/model/item_attrs.py @@ -113,7 +113,7 @@ def get_item_annotation_obj(db_session, user, item): # Get annotation association class. annotation_assoc_class = _get_annotation_assoc_class(item) - if not annotation_assoc_class: + if not annotation_assoc_class or item.id is None: return None # Get annotation association object. From d47a0661e26daf626ea6c4c11b634efbf193a5ea Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 20 Nov 2020 21:25:40 +0100 Subject: [PATCH 03/13] Debounce step label onchange Onchange seems to trigger at every character. This migth be a bit heavy for the reactivity system in Node.vue ? --- client/src/components/Workflow/Editor/Node.vue | 8 ++++++++ client/src/components/Workflow/Editor/modules/forms.js | 5 ++++- lib/galaxy_test/selenium/test_workflow_editor.py | 8 -------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/client/src/components/Workflow/Editor/Node.vue b/client/src/components/Workflow/Editor/Node.vue index b636928d8e1..5539fa84c5d 100644 --- a/client/src/components/Workflow/Editor/Node.vue +++ b/client/src/components/Workflow/Editor/Node.vue @@ -292,6 +292,14 @@ export default { this.$emit("onActivate", this); }); }, + setAnnotation(annotation) { + if (this.annotationTimeout) { + clearTimeout(this.annotationTimeout); + } + this.annotationTimeout = setTimeout(() => { + this.annotation = annotation; + }, 100); + }, setData(data) { this.config_form = data.config_form; this.tool_state = data.tool_state; diff --git a/client/src/components/Workflow/Editor/modules/forms.js b/client/src/components/Workflow/Editor/modules/forms.js index c2de695e0c0..a9eeab9f253 100644 --- a/client/src/components/Workflow/Editor/modules/forms.js +++ b/client/src/components/Workflow/Editor/modules/forms.js @@ -116,10 +116,13 @@ function _addLabelAnnotation(self, node) { inputs.unshift({ type: "text", name: "__annotation", - label: "Annotation", + label: "Step Annotation", fixed: true, value: node.annotation, area: true, + onchange: function (new_annotation) { + node.setAnnotation(new_annotation); + }, help: "Add an annotation or notes to this step. Annotations are available when a workflow is viewed.", }); inputs.unshift({ diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index 190dc92c98a..572a449386e 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -62,10 +62,6 @@ class WorkflowEditorTestCase(SeleniumTestCase): self.screenshot("workflow_editor_data_input_new") editor.label_input.wait_for_and_send_keys("input1") editor.annotation_input.wait_for_and_send_keys("my cool annotation") - self.sleep_for(self.wait_types.UX_RENDER) - self.screenshot("workflow_editor_data_input_filled_in PRECLICK") - editor.label_input.wait_for_and_click() # Seems to help force the save of whole annotation. - self.sleep_for(self.wait_types.UX_RENDER) self.screenshot("workflow_editor_data_input_filled_in") self.workflow_editor_click_save() @@ -89,8 +85,6 @@ class WorkflowEditorTestCase(SeleniumTestCase): self.screenshot("workflow_editor_data_collection_input_new") editor.label_input.wait_for_and_send_keys("input1") editor.annotation_input.wait_for_and_send_keys("my cool annotation") - editor.label_input.wait_for_and_click() # Seems to help force the save of whole annotation. - self.sleep_for(self.wait_types.UX_RENDER) self.screenshot("workflow_editor_data_collection_input_filled_in") self.workflow_editor_click_save() @@ -115,8 +109,6 @@ class WorkflowEditorTestCase(SeleniumTestCase): self.screenshot("workflow_editor_parameter_input_new") editor.label_input.wait_for_and_send_keys("input1") editor.annotation_input.wait_for_and_send_keys("my cool annotation") - editor.label_input.wait_for_and_click() # Seems to help force the save of whole annotation. - self.sleep_for(self.wait_types.UX_RENDER) self.screenshot("workflow_editor_parameter_input_filled_in") self.workflow_editor_click_save() From 3781304830cca1482081b7eb4f8fbcdc942d034d Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 20 Nov 2020 21:26:44 +0100 Subject: [PATCH 04/13] Fix non_data_connection selenium test --- lib/galaxy_test/selenium/test_workflow_editor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index 572a449386e..dc453402646 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -138,16 +138,16 @@ steps: inttest: input_int """) self.screenshot("workflow_editor_parameter_connection_simple") - self.assert_connected("input_int#output", "simple_constructs#inttest") + self.assert_connected("input_int#output", "tool_exec#inttest") editor = self.components.workflow_editor - tool_node = editor.node._(label="simple_constructs") + tool_node = editor.node._(label="tool_exec") tool_input = tool_node.input_terminal(name="inttest") tool_input.wait_for_and_click() editor.connector_destroy_callout.wait_for_and_click() - self.assert_not_connected("input_int#output", "simple_constructs#inttest") + self.assert_not_connected("input_int#output", "tool_exec#inttest") self.screenshot("workflow_editor_parameter_connection_destroyed") # When connected, cannot turn it into a RuntimeValue.. @@ -169,8 +169,8 @@ steps: tool_input.wait_for_visible() collapse_input.wait_for_absent_or_hidden() - self.workflow_editor_connect("input_int#output", "simple_constructs#inttest", screenshot_partial="workflow_editor_parameter_connection_dragging") - self.assert_connected("input_int#output", "simple_constructs#inttest") + self.workflow_editor_connect("input_int#output", "tool_exec#inttest", screenshot_partial="workflow_editor_parameter_connection_dragging") + self.assert_connected("input_int#output", "tool_exec#inttest") @selenium_test def test_existing_connections(self): From 3c515fa7f0ae699fa3ce5d44c866f272dcd981de Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 20 Nov 2020 21:59:26 +0100 Subject: [PATCH 05/13] Also debounce label Not sure if that really works, I assume `form.trigger("change")` is what's updating the label on the Node vue instance ? --- client/src/components/Workflow/Editor/Node.vue | 8 ++++++++ client/src/components/Workflow/Editor/modules/forms.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/components/Workflow/Editor/Node.vue b/client/src/components/Workflow/Editor/Node.vue index 5539fa84c5d..d65aa1df53c 100644 --- a/client/src/components/Workflow/Editor/Node.vue +++ b/client/src/components/Workflow/Editor/Node.vue @@ -300,6 +300,14 @@ export default { this.annotation = annotation; }, 100); }, + setLabel(label) { + if (this.labelTimeout) { + clearTimeout(this.labelTimeout); + } + this.labelTimeout = setTimeout(() => { + this.label = label; + }, 100); + }, setData(data) { this.config_form = data.config_form; this.tool_state = data.tool_state; diff --git a/client/src/components/Workflow/Editor/modules/forms.js b/client/src/components/Workflow/Editor/modules/forms.js index a9eeab9f253..530720382a3 100644 --- a/client/src/components/Workflow/Editor/modules/forms.js +++ b/client/src/components/Workflow/Editor/modules/forms.js @@ -133,6 +133,7 @@ function _addLabelAnnotation(self, node) { help: _l("Add a step label."), fixed: true, onchange: function (new_label) { + node.setLabel(new_label); let duplicate = false; for (const i in workflow.nodes) { const n = workflow.nodes[i]; @@ -148,7 +149,6 @@ function _addLabelAnnotation(self, node) { "error_text", duplicate && "Duplicate label. Please fix this before saving the workflow." ); - self.form.trigger("change"); }, }); } From e1b28b53456e2d46ec5397ba8feb670fb73b57a7 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 22 Nov 2020 16:20:55 +0100 Subject: [PATCH 06/13] Re-add sleep --- lib/galaxy_test/selenium/test_workflow_editor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index dc453402646..d5ddb71795c 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -62,6 +62,7 @@ class WorkflowEditorTestCase(SeleniumTestCase): self.screenshot("workflow_editor_data_input_new") editor.label_input.wait_for_and_send_keys("input1") editor.annotation_input.wait_for_and_send_keys("my cool annotation") + self.sleep_for(self.wait_types.UX_RENDER) self.screenshot("workflow_editor_data_input_filled_in") self.workflow_editor_click_save() @@ -85,6 +86,7 @@ class WorkflowEditorTestCase(SeleniumTestCase): self.screenshot("workflow_editor_data_collection_input_new") editor.label_input.wait_for_and_send_keys("input1") editor.annotation_input.wait_for_and_send_keys("my cool annotation") + self.sleep_for(self.wait_types.UX_RENDER) self.screenshot("workflow_editor_data_collection_input_filled_in") self.workflow_editor_click_save() @@ -109,6 +111,7 @@ class WorkflowEditorTestCase(SeleniumTestCase): self.screenshot("workflow_editor_parameter_input_new") editor.label_input.wait_for_and_send_keys("input1") editor.annotation_input.wait_for_and_send_keys("my cool annotation") + self.sleep_for(self.wait_types.UX_RENDER) self.screenshot("workflow_editor_parameter_input_filled_in") self.workflow_editor_click_save() From 1c0a61e0220035f16c04298b35339981d9686302 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 22 Nov 2020 12:57:57 +0100 Subject: [PATCH 07/13] Fix tool form citation selenium test Drops the show as bibtext test as we only offer copying all citations as bibtext now. --- client/src/components/Tool/ToolFooter.vue | 7 ++++++- lib/galaxy/selenium/navigation.yml | 7 ++----- lib/galaxy_test/selenium/test_tool_form.py | 8 +------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/client/src/components/Tool/ToolFooter.vue b/client/src/components/Tool/ToolFooter.vue index e4e4f089fa3..e828ebfa227 100644 --- a/client/src/components/Tool/ToolFooter.vue +++ b/client/src/components/Tool/ToolFooter.vue @@ -1,7 +1,11 @@