Skip to content

Commit

Permalink
Add more complicated workflow run test case.
Browse files Browse the repository at this point in the history
Re-use test_data specification used by many of the API workflow tests and a workflow used by another test. Add abstractions and DOM element for mapping labeled test data to tool form inputs.
  • Loading branch information
jmchilton committed Apr 13, 2018
1 parent 1ed780a commit 4ee7220
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/galaxy/scripts/mvc/tool/tool-form-composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ var View = Backbone.View.extend({
step
)
);
if(step.step_label) {
form.$el.attr("step-label", step.step_label);
}
}
self.forms[step.index] = form;
self._append(self.$steps, form.$el);
Expand Down
5 changes: 5 additions & 0 deletions test/galaxy_selenium/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ workflows:
new_button: '#new-workflow'
import_button: '#import-workflow'

workflow_run:

selectors:
input_div: "[step-label='${label}'] .select2-container"

workflow_editor:

node:
Expand Down
29 changes: 29 additions & 0 deletions test/selenium_tests/test_workflow_run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import yaml
from base.populators import load_data_dict
from base.workflow_fixtures import (
WORKFLOW_SIMPLE_CAT_TWICE,
WORKFLOW_WITH_DYNAMIC_OUTPUT_COLLECTION,
WORKFLOW_WITH_OLD_TOOL_VERSION,
)

Expand Down Expand Up @@ -39,10 +42,36 @@ def test_execution_with_tool_upgrade(self):
self.assert_warning_message(contains="different versions")
self.screenshot("workflow_run_tool_upgrade")

@selenium_test
@managed_history
def test_execution_with_multiple_inputs(self):
history_id, inputs = self.workflow_run_setup_inputs(WORKFLOW_WITH_DYNAMIC_OUTPUT_COLLECTION)
self.open_in_workflow_run(WORKFLOW_WITH_DYNAMIC_OUTPUT_COLLECTION)
self.workflow_run_specify_inputs(inputs)
self.screenshot("workflow_run_two_inputs")
self.workflow_run_submit()

self.history_panel_wait_for_hid_ok(7, allowed_force_refreshes=1)
content = self.dataset_populator.get_history_dataset_content(history_id, hid=7)
self.assertEqual("10.0\n30.0\n20.0\n40.0\n", content)

def open_in_workflow_run(self, yaml_content):
name = self.workflow_upload_yaml_with_random_name(yaml_content)
self.workflow_run_with_name(name)

def workflow_run_setup_inputs(self, content):
history_id = self.current_history_id()
test_data = yaml.safe_load(content)["test_data"]
inputs, _, _ = load_data_dict(history_id, test_data, self.dataset_populator, self.dataset_collection_populator)
self.dataset_populator.wait_for_history(history_id)
return history_id, inputs

def workflow_run_specify_inputs(self, inputs):
workflow_run = self.components.workflow_run
for label, value in inputs.items():
input_div_element = workflow_run.input_div(label=label).wait_for_visible()
self.select2_set_value(input_div_element, "%d: " % value["hid"])

def workflow_run_with_name(self, name):
self.workflow_index_open()
self.workflow_index_search_for(name)
Expand Down

0 comments on commit 4ee7220

Please sign in to comment.