16719: Adds integration test for old collection version display.
[arvados-workbench2.git] / cypress / support / commands.js
index fd5139981fc421cf4304548c8c9980841b273710..228e1cabb14e3b68fe43705add938c03cc45bb0d 100644 (file)
@@ -125,6 +125,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 +153,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}`);