From 5a5fa9a44054d166900765fd59805ac970a5663a Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 26 Aug 2024 23:06:19 +0530 Subject: [PATCH] fix(tests): workspace, awesome_bar --- cypress/integration/awesome_bar.js | 9 ++++++--- cypress/integration/workspace.js | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cypress/integration/awesome_bar.js b/cypress/integration/awesome_bar.js index 07abb51873..cc4ae4f8e3 100644 --- a/cypress/integration/awesome_bar.js +++ b/cypress/integration/awesome_bar.js @@ -10,7 +10,10 @@ context("Awesome Bar", () => { }); beforeEach(() => { - cy.findByPlaceholderText("Search or type a command (Ctrl + G)").as("awesome_bar"); + let txt = `Search or type a command (${ + window.navigator.platform === "MacIntel" ? "⌘" : "Ctrl" + } + G)`; + cy.findByPlaceholderText(txt).as("awesome_bar"); cy.get("@awesome_bar").type("{selectall}"); }); @@ -34,13 +37,13 @@ context("Awesome Bar", () => { cy.get("@awesome_bar").type("{enter}"); cy.get(".title-text").should("contain", "To Do"); cy.wait(400); // Wait a bit longer before checking the filter. - cy.get('[data-original-title="ID"] > input').should("have.value", "%test%"); + cy.get('[data-original-title="ID"]:visible > input').should("have.value", "%test%"); // filter preserved, now finds something else cy.visit("/app/todo"); cy.get(".title-text").should("contain", "To Do"); cy.wait(200); // Wait a bit longer before checking the filter. - cy.get('[data-original-title="ID"] > input').as("filter"); + cy.get('[data-original-title="ID"]:visible > input').as("filter"); cy.get("@filter").should("have.value", "%test%"); cy.get("@awesome_bar").type("anothertest in todo"); cy.wait(200); // Wait a bit longer before hitting enter. diff --git a/cypress/integration/workspace.js b/cypress/integration/workspace.js index 21687c59c3..7c15ee1fab 100644 --- a/cypress/integration/workspace.js +++ b/cypress/integration/workspace.js @@ -20,6 +20,8 @@ context("Workspace 2.0", () => { cy.get(".codex-editor__redactor .ce-block"); cy.get(".btn-new-workspace").click(); cy.fill_field("title", "Test Private Page", "Data"); + cy.wait(300); + cy.get_open_dialog().find(".modal-header").click(); cy.get_open_dialog().find(".btn-primary").click(); @@ -29,7 +31,7 @@ context("Workspace 2.0", () => { "item-public", "0" ); - + cy.wait(300); cy.get('.standard-actions .btn-primary[data-label="Save"]').click(); cy.wait(300); cy.get('.sidebar-item-container[item-name="Test Private Page"]').should( @@ -52,6 +54,7 @@ context("Workspace 2.0", () => { cy.fill_field("title", "Test Child Page", "Data"); cy.fill_field("parent", "Test Private Page", "Select"); cy.get_open_dialog().find(".modal-header").click(); + cy.wait(300); cy.get_open_dialog().find(".btn-primary").click(); // check if sidebar item is added in pubic section @@ -60,7 +63,7 @@ context("Workspace 2.0", () => { "item-public", "0" ); - + cy.wait(300); cy.get('.standard-actions .btn-primary[data-label="Save"]').click(); cy.wait(300); cy.get('.sidebar-item-container[item-name="Test Child Page"]').should( @@ -112,7 +115,7 @@ context("Workspace 2.0", () => { cy.get(".ce-block:last").should("have.class", "col-xs-11"); cy.get(".ce-block:last .dropdown-item").contains("Expand").click(); cy.get(".ce-block:last").should("have.class", "col-xs-12"); - + cy.wait(300); cy.get('.standard-actions .btn-primary[data-label="Save"]').click(); }); });