18284: Fix small bug and add tests for vm login admin
[arvados-workbench2.git] / cypress / support / commands.js
index 07290e550aa3b6beceba61559a477216ef220435..cfdfa9ecffb0e94c2262d0f580b8222f3d7b2c72 100644 (file)
@@ -150,6 +150,15 @@ Cypress.Commands.add(
     }
 )
 
+Cypress.Commands.add(
+    "createVirtualMachine", (token, data) => {
+        return cy.createResource(token, 'virtual_machines', {
+            virtual_machine: JSON.stringify(data),
+            ensure_unique_name: true
+        })
+    }
+)
+
 Cypress.Commands.add(
     "createResource", (token, suffix, data) => {
         return cy.doRequest('POST', '/arvados/v1/' + suffix, data, null, token, true)
@@ -318,4 +327,4 @@ function b64toBlob(b64Data, contentType = '', sliceSize = 512) {
 
     const blob = new Blob(byteArrays, { type: contentType });
     return blob
-}
\ No newline at end of file
+}