🧪Cypress
Also known as Cypress.io, Cypress Testing, Cypress E2E
A JavaScript tool that tests web apps in a real browser. You see each step.
Think of it like
Think of it like a robot shopper you can watch. It walks through your store while you see each step.
Example
Jack's Cypress test opens the shop, adds a mug and checks the cart shows 1. It runs on every pull request.
Why it matters
You can watch each step of a failing test, which makes it fast to fix.
Definition
Example code
javascript
it("adds a mug to the cart", () => {
cy.visit("/shop");
cy.contains("Add to cart").click();
cy.get("[data-cy=cart-count]").should("have.text", "1");
});Common mistake
Key takeaways
- 1Real browser. Runs beside the app.
- 2Watch it run. Step back through each action.
- 3Stable labels. Find elements by test labels.