X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/14903d601d6c878f1d772f0b91c0877891a2e78c..7f551720c59d8602bc4d810b243910f186179596:/cypress/support/commands.js diff --git a/cypress/support/commands.js b/cypress/support/commands.js index fd513998..bba04ba8 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -116,6 +116,16 @@ Cypress.Commands.add( } ) + +Cypress.Commands.add( + "createWorkflow", (token, data) => { + return cy.createResource(token, 'workflows', { + workflow: JSON.stringify(data), + ensure_unique_name: true + }) + } +) + Cypress.Commands.add( "createCollection", (token, data) => { return cy.createResource(token, 'collections', { @@ -125,6 +135,14 @@ Cypress.Commands.add( } ) +Cypress.Commands.add( + "updateCollection", (token, uuid, data) => { + return cy.updateResource(token, 'collections', uuid, { + collection: JSON.stringify(data) + }) + } +) + Cypress.Commands.add( "createResource", (token, suffix, data) => { return cy.doRequest('POST', '/arvados/v1/'+suffix, data, null, token, true) @@ -145,6 +163,16 @@ Cypress.Commands.add( } ) +Cypress.Commands.add( + "updateResource", (token, suffix, uuid, data) => { + return cy.doRequest('PUT', '/arvados/v1/'+suffix+'/'+uuid, data, null, token, true) + .its('body').as('resource') + .then(function() { + return this.resource; + }) + } +) + Cypress.Commands.add( "loginAs", (user) => { cy.visit(`/token/?api_token=${user.token}`); @@ -153,3 +181,9 @@ Cypress.Commands.add( cy.get('div#root').should('not.contain', 'Your account is inactive'); } ) + +Cypress.Commands.add( + "doSearch", (searchTerm) => { + cy.get('[data-cy=searchbar-input-field]').type(`{selectall}${searchTerm}{enter}`); + } +) \ No newline at end of file