1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 describe('Registered workflow panel tests', function() {
10 // Only set up common users once. These aren't set up as aliases because
11 // aliases are cleaned up after every test. Also it doesn't make sense
12 // to set the same users on beforeEach() over and over again, so we
13 // separate a little from Cypress' 'Best Practices' here.
14 cy.getUser('admin', 'Admin', 'User', true, true)
15 .as('adminUser').then(function() {
16 adminUser = this.adminUser;
19 cy.getUser('user', 'Active', 'User', false, true)
20 .as('activeUser').then(function() {
21 activeUser = this.activeUser;
26 it('should handle null definition', function() {
27 cy.createResource(activeUser.token, "workflows", {workflow: {name: "Test wf"}})
28 .then(function(workflowResource) {
29 cy.loginAs(activeUser);
30 cy.goToPath(`/workflows/${workflowResource.uuid}`);
31 cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
32 cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);
36 it('should handle malformed definition', function() {
37 cy.createResource(activeUser.token, "workflows", {workflow: {name: "Test wf", definition: "zap:"}})
38 .then(function(workflowResource) {
39 cy.loginAs(activeUser);
40 cy.goToPath(`/workflows/${workflowResource.uuid}`);
41 cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
42 cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);
46 it('should handle malformed run', function() {
47 cy.createResource(activeUser.token, "workflows", {workflow: {
49 definition: JSON.stringify({
59 "class": "SubworkflowFeatureRequirement"
64 "id": "#main/cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
66 "label": "cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
69 "id": "#main/step/args"
72 "run": `keep:undefined/bar`
78 "http://arvados.org/cwl#gitBranch": "1.2.1_proposed",
79 "http://arvados.org/cwl#gitCommit": "9b091ed7e0bef98b3312e9478c52b89ba25792de",
80 "http://arvados.org/cwl#gitCommitter": "GitHub <noreply@github.com>",
81 "http://arvados.org/cwl#gitDate": "Sun, 11 Sep 2022 21:24:42 +0200",
82 "http://arvados.org/cwl#gitDescribe": "v1.2.0-109-g9b091ed",
83 "http://arvados.org/cwl#gitOrigin": "git@github.com:common-workflow-language/cwl-v1.2",
84 "http://arvados.org/cwl#gitPath": "tests/cat1-testcli.cwl",
85 "http://arvados.org/cwl#gitStatus": ""
87 }}).then(function(workflowResource) {
88 cy.loginAs(activeUser);
89 cy.goToPath(`/workflows/${workflowResource.uuid}`);
90 cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
91 cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);
95 const verifyIOParameter = (name, label, doc, val, collection) => {
96 cy.get('table tr').contains(name).parents('tr').within(($mainRow) => {
97 label && cy.contains(label);
100 if (Array.isArray(val)) {
101 val.forEach(v => cy.contains(v));
107 cy.contains(collection);
112 it('shows workflow details', function() {
113 cy.createCollection(adminUser.token, {
114 name: `Test collection ${Math.floor(Math.random() * 999999)}`,
115 owner_uuid: activeUser.user.uuid,
116 manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
118 .then(function(collectionResource) {
119 cy.createResource(activeUser.token, "workflows", {workflow: {
121 definition: JSON.stringify({
128 "class": "DockerRequirement",
129 "dockerPull": "python:2-slim"
139 "id": "#main/numbering",
147 "basename": "args.py",
149 "location": "keep:de738550734533c5027997c87dc5488e+53/args.py",
154 "id": "#main/args.py",
161 "outputSource": "#main/step/args",
164 "name": "_:b0adccc1-502d-476f-8a5b-c8ef7119e2dc",
171 "class": "SubworkflowFeatureRequirement"
176 "id": "#main/cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
179 "id": "#main/step/file1",
180 "source": "#main/file1"
183 "id": "#main/step/numbering",
184 "source": "#main/numbering"
187 "id": "#main/step/args.py",
188 "source": "#main/args.py"
191 "label": "cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
194 "id": "#main/step/args"
197 "run": `keep:${collectionResource.portable_data_hash}/bar`
202 "cwlVersion": "v1.2",
203 "http://arvados.org/cwl#gitBranch": "1.2.1_proposed",
204 "http://arvados.org/cwl#gitCommit": "9b091ed7e0bef98b3312e9478c52b89ba25792de",
205 "http://arvados.org/cwl#gitCommitter": "GitHub <noreply@github.com>",
206 "http://arvados.org/cwl#gitDate": "Sun, 11 Sep 2022 21:24:42 +0200",
207 "http://arvados.org/cwl#gitDescribe": "v1.2.0-109-g9b091ed",
208 "http://arvados.org/cwl#gitOrigin": "git@github.com:common-workflow-language/cwl-v1.2",
209 "http://arvados.org/cwl#gitPath": "tests/cat1-testcli.cwl",
210 "http://arvados.org/cwl#gitStatus": ""
212 }}).then(function(workflowResource) {
213 cy.loginAs(activeUser);
214 cy.goToPath(`/workflows/${workflowResource.uuid}`);
215 cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
216 cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);
217 cy.get('[data-cy=registered-workflow-info-panel')
218 .should('contain', 'gitCommit: 9b091ed7e0bef98b3312e9478c52b89ba25792de')
220 cy.get('[data-cy=process-io-card] h6').contains('Inputs')
221 .parents('[data-cy=process-io-card]').within(() => {
222 verifyIOParameter('file1', null, '', '', '');
223 verifyIOParameter('numbering', null, '', '', '');
224 verifyIOParameter('args.py', null, '', 'args.py', 'de738550734533c5027997c87dc5488e+53');
226 cy.get('[data-cy=process-io-card] h6').contains('Outputs')
227 .parents('[data-cy=process-io-card]').within(() => {
228 verifyIOParameter('args', null, '', '', '');
230 cy.get('[data-cy=collection-files-panel]').within(() => {
231 cy.get('[data-cy=collection-files-right-panel]', { timeout: 5000 })
232 .should('contain', 'bar');