From d12b46657b3e3e341676ce48932c0cc961763abb Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 5 Mar 2024 18:37:27 -0300 Subject: [PATCH] 21461: Makes properties' test behave better on Firefox. Also, only enable clipboard-related tests on electron. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- services/workbench2/cypress/e2e/project.cy.js | 28 +++++++++++-------- services/workbench2/cypress/e2e/search.cy.js | 4 ++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/services/workbench2/cypress/e2e/project.cy.js b/services/workbench2/cypress/e2e/project.cy.js index a7e7002759..4aeb59bc75 100644 --- a/services/workbench2/cypress/e2e/project.cy.js +++ b/services/workbench2/cypress/e2e/project.cy.js @@ -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); diff --git a/services/workbench2/cypress/e2e/search.cy.js b/services/workbench2/cypress/e2e/search.cy.js index 4411c9ffb4..1bf2b5c3ef 100644 --- a/services/workbench2/cypress/e2e/search.cy.js +++ b/services/workbench2/cypress/e2e/search.cy.js @@ -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"; -- 2.30.2