byteNative
Testing & Quality

Cypress

Convenient E2E testing with excellent debugging.

What is Cypress?

Cypress offers convenient end-to-end and component testing with excellent debugging and a clear interface. The test runner replays every step as a timeline, so you time-travel back and see exactly what state the browser was in at each command. That makes tracking down problems pleasantly direct, because you do not have to reproduce the bug first. So even more extensive browser tests stay easy to follow and maintain.

More in the documentation

How we use it

When a team already works with Cypress or values the interactive runner as a debugging tool, we build the browser tests on it. We like using it to run alongside live while building a complex flow and spot issues immediately in a real browser. For existing Cypress suites we maintain and extend them rather than rewriting them without reason.

ts
describe("search", () => {
  it("shows results", () => {
    cy.intercept("GET", "/api/search*").as("search");
    cy.visit("/");
    cy.get("[name=q]").type("playwright{enter}");
    cy.wait("@search");
    cy.contains("results").should("be.visible");
  });
});
Wait on a real response instead of a fixed time.

Good to know

Cypress commands are chained and async but not promises; awaiting them is misleading, use .then or cy.wrap instead. Avoid cy.wait with a fixed millisecond number and wait on an intercepted route via cy.intercept instead, otherwise tests turn slow and flaky.

00Testing & Quality

More tools we work with in the same area.

Which technology fits you?

You don't have to decide that, it's our job. Tell us about your plans.