🧩 Actions, Forms & Drag & Drop

Actions, Forms & Drag & Drop: cy.type(), cy.click(), cy.check(), cy.uncheck(), and cy.select() are the core form actions.

cy.type(), cy.click(), cy.check(), cy.uncheck(), and cy.select() are the core form actions. All of them are retry-able: they automatically wait until the element is visible, enabled (not disabled), and "actionable" (not covered by another element). If an element genuinely cannot be clicked but you want to test it anyway, you can deliberately bypass these checks with { force: true }.

Micro Lab: Cypress — API Intercept

Replace the TODO line with the critical line from the expected solution. This is not a real runtime; the goal is to reinforce writing the correct structure in a controlled way.

Step by Step: Cypress — API Intercept

Determine which endpoint to capture: URL pattern or method + pattern

Set up: cy.intercept("GET", "**/api/users", { fixture: "users.json" }).as("getUsers")

Trigger cy.visit() or action, wait for the intercept to fire

Wait for the request with cy.wait("@getUsers")

Verify: cy.get("@getUsers").its("response.statusCode").should("eq", 200)

What is the Cypress API intercept setup order?

Mini Exercise: Build the Login Test

Find the email field

Find the password field

Why Native HTML5 Drag & Drop Is Tricky for Cypress