Next version: 13.4.12
When I am on examples
page and then click on home
– new page is loaded and everything is fine.
But when I click again on examples
– nothing happens and in console I can see that click was preventedDefault.
I don’t understand. Why?
But when add between these clicks one more navigation link overview
– tests start to work fine.
//error
describe("examples", () => {
beforeEach(() => {
cy.visit("/examples");
});
it("multipage-test", () => {
cy.getByTestId("home").click();
cy.location("pathname").should("equal", "/");
<--- nothing here --->
cy.getByTestId("examples").should("be.visible").click();
cy.location("pathname").should("equal", "/examples");
});
});
// success
describe("examples", () => {
beforeEach(() => {
cy.visit("/examples");
});
it("multipage-test", () => {
cy.getByTestId("home").click();
cy.location("pathname").should("equal", "/");
cy.getByTestId("overview").should("be.visible").click();
cy.location("pathname").should("equal", "/overview");
cy.getByTestId("examples").should("be.visible").click();
cy.location("pathname").should("equal", "/examples");
});
});
I tried trigger
and click({force: true})
– it doesn’t help