Merge branch '21448-menu-reorder' into 21224-project-details
[arvados.git] / services / workbench2 / cypress / e2e / project.cy.js
index a7e70027595ed89bcb2389c39298667fe38e16b4..43215741f531917629c11c3dda43b531a150eda6 100644 (file)
@@ -39,20 +39,22 @@ describe("Project tests", function () {
         cy.get("[data-cy=form-dialog]").should("not.contain", "Color: Magenta");
         cy.get("[data-cy=resource-properties-form]").within(() => {
             cy.get("[data-cy=property-field-key]").within(() => {
-                cy.get("input").type("Color");
+                cy.get("input").type("Color").blur();
             });
             cy.get("[data-cy=property-field-value]").within(() => {
-                cy.get("input").type("Magenta");
+                cy.get("input").type("Magenta").blur();
             });
-            cy.root().submit();
+            cy.get("[data-cy=property-add-btn]").click();
+
             cy.get("[data-cy=property-field-value]").within(() => {
-                cy.get("input").type("Pink");
+                cy.get("input").type("Pink").blur();
             });
-            cy.root().submit();
+            cy.get("[data-cy=property-add-btn]").click();
+
             cy.get("[data-cy=property-field-value]").within(() => {
-                cy.get("input").type("Yellow");
+                cy.get("input").type("Yellow").blur();
             });
-            cy.root().submit();
+            cy.get("[data-cy=property-add-btn]").click();
         });
         // Confirm proper vocabulary labels are displayed on the UI.
         cy.get("[data-cy=form-dialog]").should("contain", "Color: Magenta");
@@ -95,14 +97,14 @@ describe("Project tests", function () {
         // Add another property
         cy.get("[data-cy=resource-properties-form]").within(() => {
             cy.get("[data-cy=property-field-key]").within(() => {
-                cy.get("input").type("Animal");
+                cy.get("input").type("Animal").blur();
             });
             cy.get("[data-cy=property-field-value]").within(() => {
-                cy.get("input").type("Dog");
+                cy.get("input").type("Dog").blur();
             });
-            cy.root().submit();
+            cy.get("[data-cy=property-add-btn]").click();
         });
-        cy.get("[data-cy=form-submit-btn]").click({ force: true });
+        cy.get("[data-cy=form-submit-btn]").click();
         // Reopen edit via breadcrumbs and verify properties
         cy.get("[data-cy=breadcrumbs]").contains(projName).rightclick();
         cy.get("[data-cy=context-menu]").contains("Edit").click();
@@ -217,18 +219,18 @@ describe("Project tests", function () {
     it('shows the appropriate buttons in the multiselect toolbar', () => {
 
         const msButtonTooltips = [
+            'View details',
+            'Open in new tab',
+            'Copy link to clipboard',
+            'Open with 3rd party client',
             'API Details',
-            'Add to Favorites',
-            'Copy to clipboard',
+            'Share',
+            'New project',
             'Edit project',
-            'Freeze Project',
             'Move to',
             'Move to trash',
-            'New project',
-            'Open in new tab',
-            'Open with 3rd party client',
-            'Share',
-            'View details',
+            'Freeze project',
+            'Add to favorites',
         ];
 
         cy.loginAs(activeUser);
@@ -612,7 +614,9 @@ describe("Project tests", function () {
         });
     });
 
-    it("copies project URL to clipboard", () => {
+    // The following test is enabled on Electron only, as Chromium and Firefox
+    // require permissions to access the clipboard.
+    it("copies project URL to clipboard", { browser: 'electron' }, () => {
         const projectName = `Test project (${Math.floor(999999 * Math.random())})`;
 
         cy.loginAs(activeUser);
@@ -632,7 +636,7 @@ describe("Project tests", function () {
         cy.get("[data-cy=side-panel-tree]").contains("Projects").click();
         cy.waitForDom();
         cy.get("[data-cy=project-panel]").contains(projectName).should("be.visible").rightclick();
-        cy.get("[data-cy=context-menu]").contains("Copy to clipboard").click();
+        cy.get("[data-cy=context-menu]").contains("Copy link to clipboard").click();
         cy.window().then(win =>
             win.navigator.clipboard.readText().then(text => {
                 expect(text).to.match(/https\:\/\/127\.0\.0\.1\:[0-9]+\/projects\/[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/);