Skip to content
Snippets Groups Projects
Unverified Commit 92238be2 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

[E2E] Fix search flake (#28450)

* Reinforce test by waiting for results to appear
parent 1210bad5
No related branches found
No related tags found
No related merge requests found
......@@ -38,18 +38,21 @@ describe("scenarios > auth > search", () => {
cy.findByText("Didn't find anything");
});
it("allows select a search result from keyboard", () => {
it("allows to select a search result using keyboard", () => {
cy.intercept("GET", "/api/search*").as("search");
cy.signInAsNormalUser();
cy.visit("/");
cy.findByPlaceholderText("Search…").type("ord");
cy.wait("@search");
cy.findAllByTestId("search-result-item-name")
.first()
.should("have.text", "Orders");
cy.get("body").trigger("keydown", { key: "ArrowDown" });
cy.get("body").trigger("keydown", { key: "Enter" });
cy.realPress("ArrowDown");
cy.realPress("Enter");
cy.url().should("match", /\/question\/1-orders$/);
cy.location("pathname").should("eq", "/question/1-orders");
});
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment