16811: Add cypress test for setting/unsetting public favorite
[arvados-workbench2.git] / cypress / support / commands.js
index 8baa2db6e58398b969ecd97fdb3bc6a481ef5d3e..fd5139981fc421cf4304548c8c9980841b273710 100644 (file)
@@ -110,6 +110,12 @@ Cypress.Commands.add(
     }
 )
 
+Cypress.Commands.add(
+    "trashGroup", (token, uuid) => {
+        return cy.deleteResource(token, 'groups', uuid);
+    }
+)
+
 Cypress.Commands.add(
     "createCollection", (token, data) => {
         return cy.createResource(token, 'collections', {
@@ -129,6 +135,16 @@ Cypress.Commands.add(
     }
 )
 
+Cypress.Commands.add(
+    "deleteResource", (token, suffix, uuid) => {
+        return cy.doRequest('DELETE', '/arvados/v1/'+suffix+'/'+uuid)
+        .its('body').as('resource')
+        .then(function() {
+            return this.resource;
+        })
+    }
+)
+
 Cypress.Commands.add(
     "loginAs", (user) => {
         cy.visit(`/token/?api_token=${user.token}`);
@@ -136,4 +152,4 @@ Cypress.Commands.add(
         cy.get('div#root').should('contain', 'Arvados Workbench (zzzzz)');
         cy.get('div#root').should('not.contain', 'Your account is inactive');
     }
-)
\ No newline at end of file
+)