fix(tests): workspace, awesome_bar

This commit is contained in:
Rushabh Mehta 2024-08-26 23:06:19 +05:30
parent 8793ca506f
commit 5a5fa9a440
2 changed files with 12 additions and 6 deletions

View file

@ -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.

View file

@ -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();
});
});