[arvados-workbench2] updated: 2.7.0-143-g4841996e

git repository hosting git at public.arvados.org
Wed Oct 11 19:12:10 UTC 2023


Summary of changes:
 cypress/support/commands.js                      | 215 ++++++++++++-----------
 src/store/collections/collection-copy-actions.ts |   8 +
 2 files changed, 117 insertions(+), 106 deletions(-)

       via  4841996e3529dc42aa0cbae94389fad85bdde2f6 (commit)
       via  350def36fb45c1448e98c4a0bf3f149dee2d5405 (commit)
      from  fa88d59460b053577e5403e27465495d369353f6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 4841996e3529dc42aa0cbae94389fad85bdde2f6
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Wed Oct 11 15:12:03 2023 -0400

    15768: fixed commands.js so int tests run Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/cypress/support/commands.js b/cypress/support/commands.js
index 46d77fe8..c0291e26 100644
--- a/cypress/support/commands.js
+++ b/cypress/support/commands.js
@@ -67,6 +67,23 @@ Cypress.Commands.add(
     }
 );
 
+Cypress.Commands.add(
+    "doWebDAVRequest",
+    (method = "GET", path = "", data = null, qs = null, token = systemToken, auth = false, followRedirect = true, failOnStatusCode = true) => {
+        return cy.doRequest("GET", "/arvados/v1/config", null, null).then(({ body: config }) => {
+            return cy.request({
+                method: method,
+                url: `${config.Services.WebDAVDownload.ExternalURL.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`,
+                body: data,
+                qs: auth ? qs : Object.assign({ api_token: token }, qs),
+                auth: auth ? { bearer: `${token}` } : undefined,
+                followRedirect: followRedirect,
+                failOnStatusCode: failOnStatusCode,
+            });
+        });
+    }
+);
+
 Cypress.Commands.add("getUser", (username, first_name = "", last_name = "", is_admin = false, is_active = true) => {
     // Create user if not already created
     return (
@@ -146,116 +163,22 @@ Cypress.Commands.add("createLink", (token, data) => {
     });
 });
 
-Cypress.Commands.add(
-    "doWebDAVRequest",
-    (method = "GET", path = "", data = null, qs = null, token = systemToken, auth = false, followRedirect = true, failOnStatusCode = true) => {
-        return cy.doRequest("GET", "/arvados/v1/config", null, null).then(({ body: config }) => {
-            return cy.request({
-                method: method,
-                url: `${config.Services.WebDAVDownload.ExternalURL.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`,
-                body: data,
-                qs: auth ? qs : Object.assign({ api_token: token }, qs),
-                auth: auth ? { bearer: `${token}` } : undefined,
-                followRedirect: followRedirect,
-                failOnStatusCode: failOnStatusCode,
-            });
-        });
-    }
-);
-
-Cypress.Commands.add("getUser", (username, first_name = "", last_name = "", is_admin = false, is_active = true) => {
-    // Create user if not already created
-    return (
-        cy
-            .doRequest(
-                "POST",
-                "/auth/controller/callback",
-                {
-                    auth_info: JSON.stringify({
-                        email: `${username}@example.local`,
-                        username: username,
-                        first_name: first_name,
-                        last_name: last_name,
-                        alternate_emails: [],
-                    }),
-                    return_to: ",https://example.local",
-                },
-                null,
-                systemToken,
-                true,
-                false
-            ) // Don't follow redirects so we can catch the token
-            .its("headers.location")
-            .as("location")
-            // Get its token and set the account up as admin and/or active
-            .then(
-                function () {
-                    this.userToken = this.location.split("=")[1];
-                    assert.isString(this.userToken);
-                    return cy
-                        .doRequest("GET", "/arvados/v1/users", null, {
-                            filters: `[["username", "=", "${username}"]]`,
-                        })
-                        .its("body.items.0")
-                        .as("aUser")
-                        .then(function () {
-                            cy.doRequest("PUT", `/arvados/v1/users/${this.aUser.uuid}`, {
-                                user: {
-                                    is_admin: is_admin,
-                                    is_active: is_active,
-                                },
-                            }).as("lastLogRecord");
-                        });
-                },
-                cy.getAll("@lastLogRecord").then(function () {
-                    return logs;
-                })
-            )
-    );
-});
-
-Cypress.Commands.add("createVirtualMachine", (token, data) => {
-    return cy.createResource(token, "virtual_machines", {
-        virtual_machine: JSON.stringify(data),
+Cypress.Commands.add("createGroup", (token, data) => {
+    return cy.createResource(token, "groups", {
+        group: JSON.stringify(data),
         ensure_unique_name: true,
     });
 });
 
-Cypress.Commands.add("getResource", (token, suffix, uuid) => {
-    return cy
-        .doRequest("GET", `/arvados/v1/${suffix}/${uuid}`, null, {}, token)
-        .its("body")
-        .then(function (resource) {
-            return resource;
-        });
+Cypress.Commands.add("trashGroup", (token, uuid) => {
+    return cy.deleteResource(token, "groups", uuid);
 });
 
-Cypress.Commands.add("createResource", (token, suffix, data) => {
-    return cy
-        .doRequest("POST", "/arvados/v1/" + suffix, data, null, token, true)
-        .its("body")
-        .then(function (resource) {
-            createdResources.push({ suffix, uuid: resource.uuid });
-            return resource;
-        });
-});
-
-Cypress.Commands.add("deleteResource", (token, suffix, uuid, failOnStatusCode = true) => {
-    return cy
-        .doRequest("DELETE", "/arvados/v1/" + suffix + "/" + uuid, null, null, token, false, true, failOnStatusCode)
-        .its("body")
-        .then(function (resource) {
-            return resource;
-        });
-});
-
-Cypress.Commands.add("updateResource", (token, suffix, uuid, data) => {
-    return cy
-        .doRequest("PATCH", "/arvados/v1/" + suffix + "/" + uuid, data, null, token, true)
-        .its("body")
-        .then(function (resource) {
-            return resource;
-        });
+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) => {
@@ -381,11 +304,91 @@ Cypress.Commands.add("listContainerRequestLogs", (token, crUuid) =>
     )
 );
 
-cy.get("[data-cy=form-cancel-btn]").click();
+Cypress.Commands.add("createVirtualMachine", (token, data) => {
+    return cy.createResource(token, "virtual_machines", {
+        virtual_machine: JSON.stringify(data),
+        ensure_unique_name: true,
+    });
+});
+
+Cypress.Commands.add("getResource", (token, suffix, uuid) => {
+    return cy
+        .doRequest("GET", `/arvados/v1/${suffix}/${uuid}`, null, {}, token)
+        .its("body")
+        .then(function (resource) {
+            return resource;
+        });
+});
+
+Cypress.Commands.add("createResource", (token, suffix, data) => {
+    return cy
+        .doRequest("POST", "/arvados/v1/" + suffix, data, null, token, true)
+        .its("body")
+        .then(function (resource) {
+            createdResources.push({ suffix, uuid: resource.uuid });
+            return resource;
+        });
+});
+
+Cypress.Commands.add("deleteResource", (token, suffix, uuid, failOnStatusCode = true) => {
+    return cy
+        .doRequest("DELETE", "/arvados/v1/" + suffix + "/" + uuid, null, null, token, false, true, failOnStatusCode)
+        .its("body")
+        .then(function (resource) {
+            return resource;
+        });
+});
+
+Cypress.Commands.add("updateResource", (token, suffix, uuid, data) => {
+    return cy
+        .doRequest("PATCH", "/arvados/v1/" + suffix + "/" + uuid, data, null, token, true)
+        .its("body")
+        .then(function (resource) {
+            return resource;
+        });
+});
+
+Cypress.Commands.add("loginAs", user => {
+    cy.clearCookies();
+    cy.clearLocalStorage();
+    cy.visit(`/token/?api_token=${user.token}`);
+    cy.url({ timeout: 10000 }).should("contain", "/projects/");
+    cy.get("div#root").should("contain", "Arvados Workbench (zzzzz)");
+    cy.get("div#root").should("not.contain", "Your account is inactive");
+});
+
+Cypress.Commands.add("testEditProjectOrCollection", (container, oldName, newName, newDescription, isProject = true) => {
+    cy.get(container).contains(oldName).rightclick();
+    cy.get("[data-cy=context-menu]")
+        .contains(isProject ? "Edit project" : "Edit collection")
+        .click();
+    cy.get("[data-cy=form-dialog]").within(() => {
+        cy.get("input[name=name]").clear().type(newName);
+        cy.get(isProject ? "div[contenteditable=true]" : "input[name=description]")
+            .clear()
+            .type(newDescription);
+        cy.get("[data-cy=form-submit-btn]").click();
+    });
+
+    cy.get(container).contains(newName).rightclick();
+    cy.get("[data-cy=context-menu]")
+        .contains(isProject ? "Edit project" : "Edit collection")
+        .click();
+    cy.get("[data-cy=form-dialog]").within(() => {
+        cy.get("input[name=name]").should("have.value", newName);
+
+        if (isProject) {
+            cy.get("span[data-text=true]").contains(newDescription);
+        } else {
+            cy.get("input[name=description]").should("have.value", newDescription);
+        }
+
+        cy.get("[data-cy=form-cancel-btn]").click();
+    });
+});
 
 Cypress.Commands.add("doSearch", searchTerm => {
     cy.get("[data-cy=searchbar-input-field]").type(`{selectall}${searchTerm}{enter}`);
-    cy.get("[data-cy=searchbar-parent-form]").submit();
 });
 
 Cypress.Commands.add("goToPath", path => {

commit 350def36fb45c1448e98c4a0bf3f149dee2d5405
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Wed Oct 11 11:24:42 2023 -0400

    15768: restored error snackbar on copy collection 422 Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/src/store/collections/collection-copy-actions.ts b/src/store/collections/collection-copy-actions.ts
index f2f5569a..9386fe3c 100644
--- a/src/store/collections/collection-copy-actions.ts
+++ b/src/store/collections/collection-copy-actions.ts
@@ -14,6 +14,7 @@ import { progressIndicatorActions } from "store/progress-indicator/progress-indi
 import { initProjectsTreePicker } from "store/tree-picker/tree-picker-actions";
 import { getResource } from "store/resources/resources";
 import { CollectionResource } from "models/collection";
+import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
 
 export const COLLECTION_COPY_FORM_NAME = "collectionCopyFormName";
 export const COLLECTION_MULTI_COPY_FORM_NAME = "collectionMultiCopyFormName";
@@ -65,6 +66,13 @@ export const copyCollection =
                         ownerUuid: "A collection with the same name already exists in the target project.",
                     } as FormErrors)
                 );
+                dispatch(
+                    snackbarActions.OPEN_SNACKBAR({
+                        message: "Could not copy the collection.",
+                        hideDuration: 2000,
+                        kind: SnackbarKind.ERROR,
+                    })
+                );
             } else {
                 dispatch(dialogActions.CLOSE_DIALOG({ id: formName }));
                 throw new Error("Could not copy the collection.");

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list