AI Features

Cypress Waitings and Execution Order

Learn how Cypress executes and waits for commands.

Cypress waitings and execution order

In the previous lesson, we wrote the following initial test:

it("The happy path should work", () => {
  cy.visit("/register");
  cy.get(".form-control").then($els => {
    cy.get($els[0]).type("Tester");
    cy.get($els[1]).type("user@realworld.io");
    cy.get($els[2]).type("mysupersecretpassword");
    cy.get("button").click();
    cy.contains("No articles are here").should("be.visible");
  });
});

Without noting it, we’ve leveraged some of Cypress’s interesting features.

Automatic waiting

Did you notice that the test seems to have a synchronous flow? Think about what happens ...