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('shows workflow details', function() {
47 cy.createResource(activeUser.token, "workflows", {workflow: {
49 definition: JSON.stringify({
56 "class": "DockerRequirement",
57 "dockerPull": "python:2-slim"
67 "id": "#main/numbering",
75 "basename": "args.py",
77 "location": "keep:de738550734533c5027997c87dc5488e+53/args.py",
82 "id": "#main/args.py",
89 "outputSource": "#main/step/args",
92 "name": "_:b0adccc1-502d-476f-8a5b-c8ef7119e2dc",
99 "class": "SubworkflowFeatureRequirement"
104 "id": "#main/cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
107 "id": "#main/step/file1",
108 "source": "#main/file1"
111 "id": "#main/step/numbering",
112 "source": "#main/numbering"
115 "id": "#main/step/args.py",
116 "source": "#main/args.py"
119 "label": "cat1-testcli.cwl (v1.2.0-109-g9b091ed)",
122 "id": "#main/step/args"
125 "run": "keep:6b2f3b54194acf69476f22ae52c8ceaf+62/cat1-testcli.cwl"
130 "cwlVersion": "v1.2",
131 "http://arvados.org/cwl#gitBranch": "1.2.1_proposed",
132 "http://arvados.org/cwl#gitCommit": "9b091ed7e0bef98b3312e9478c52b89ba25792de",
133 "http://arvados.org/cwl#gitCommitter": "GitHub <noreply@github.com>",
134 "http://arvados.org/cwl#gitDate": "Sun, 11 Sep 2022 21:24:42 +0200",
135 "http://arvados.org/cwl#gitDescribe": "v1.2.0-109-g9b091ed",
136 "http://arvados.org/cwl#gitOrigin": "git@github.com:common-workflow-language/cwl-v1.2",
137 "http://arvados.org/cwl#gitPath": "tests/cat1-testcli.cwl",
138 "http://arvados.org/cwl#gitStatus": ""
140 }}).then(function() {
141 cy.createCollection(adminUser.token, {
142 name: `Test collection ${Math.floor(Math.random() * 999999)}`,
143 owner_uuid: activeUser.user.uuid,
144 manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
147 .then(function(workflowResource) {
148 cy.loginAs(activeUser);
149 cy.goToPath(`/workflows/${workflowResource.uuid}`);
150 cy.get('[data-cy=registered-workflow-info-panel]').should('contain', workflowResource.name);
151 cy.get('[data-cy=workflow-details-attributes-modifiedby-user]').contains(`Active User (${activeUser.user.uuid})`);