From 08bb03abd64c8cb8b4684d46a42cc95674317c58 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Tue, 20 Jun 2023 10:50:21 +0530 Subject: [PATCH] test(awesomebar): Remove unnecessary delay --- cypress/integration/awesome_bar.js | 39 +++++++++++------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/cypress/integration/awesome_bar.js b/cypress/integration/awesome_bar.js index 71e5e498cf..bb72ad1c59 100644 --- a/cypress/integration/awesome_bar.js +++ b/cypress/integration/awesome_bar.js @@ -7,50 +7,39 @@ context("Awesome Bar", () => { beforeEach(() => { cy.get(".navbar .navbar-home").click(); - cy.findByPlaceholderText("Search or type a command (Ctrl + G)").clear(); + cy.findByPlaceholderText("Search or type a command (Ctrl + G)").as("awesome_bar"); + cy.get("@awesome_bar").type("{selectall}"); }); it("navigates to doctype list", () => { - cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type("todo", { - delay: 700, - }); + cy.get("@awesome_bar").type("todo"); + cy.wait(100); cy.get(".awesomplete").findByRole("listbox").should("be.visible"); - cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type("{enter}", { - delay: 700, - }); - + cy.get("@awesome_bar").type("{enter}"); cy.get(".title-text").should("contain", "To Do"); - cy.location("pathname").should("eq", "/app/todo"); }); it("find text in doctype list", () => { - cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type( - "test in todo{enter}", - { delay: 700 } - ); - + cy.get("@awesome_bar").type("test in todo"); + cy.wait(100); + cy.get("@awesome_bar").type("{enter}"); cy.get(".title-text").should("contain", "To Do"); - cy.findByPlaceholderText("ID").should("have.value", "%test%"); cy.clear_filters(); }); it("navigates to new form", () => { - cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type( - "new blog post{enter}", - { delay: 700 } - ); - + cy.get("@awesome_bar").type("new blog post"); + cy.wait(100); + cy.get("@awesome_bar").type("{enter}"); cy.get(".title-text:visible").should("have.text", "New Blog Post"); }); it("calculates math expressions", () => { - cy.findByPlaceholderText("Search or type a command (Ctrl + G)").type( - "55 + 32{downarrow}{enter}", - { delay: 700 } - ); - + cy.get("@awesome_bar").type("55 + 32"); + cy.wait(100); + cy.get("@awesome_bar").type("{downarrow}{enter}"); cy.get(".modal-title").should("contain", "Result"); cy.get(".msgprint").should("contain", "55 + 32 = 87"); });