21461: Makes properties' test behave better on Firefox.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 5 Mar 2024 21:37:27 +0000 (18:37 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 5 Mar 2024 21:37:27 +0000 (18:37 -0300)
Also, only enable clipboard-related tests on electron.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

services/workbench2/cypress/e2e/project.cy.js
services/workbench2/cypress/e2e/search.cy.js

index a7e70027595ed89bcb2389c39298667fe38e16b4..4aeb59bc75ef4d8cfe79a6e187e3e12411fdcf5e 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();
@@ -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);
index 4411c9ffb45c18af78f627ca5fd61435603c7d87..1bf2b5c3efb4b83a8bdd8324f751ffb67d7b53c5 100644 (file)
@@ -160,7 +160,9 @@ describe("Search tests", function () {
         });
     });
 
-    it("shows search context menu", function () {
+    // The following test is enabled on Electron only, as Chromium and Firefox
+    // require permissions to access the clipboard.
+    it("shows search context menu", { browser: 'electron' } , function () {
         const colName = `Home Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
         const federatedColName = `Federated Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
         const federatedColUuid = "xxxxx-4zz18-000000000000000";