01What is Cypress Command Builder?
Cypress is easy to read and annoyingly easy to get slightly wrong. A missing @ on a wait alias, a quote inside a selector, or an assertion value passed as a string instead of a number can all cost you a debugging session. This builder lets you describe a test as a list of steps and writes the spec for you. Each step has an Action dropdown with seventeen commands: visit, click, dblclick, type, clear, check, uncheck, select, scrollTo, trigger, get, contains, find, intercept, wait, should and and. Next to it sit Selector, Value and Options fields. Most element actions come out as cy.get(selector).action(...), so a type step on #email becomes cy.get("#email").type("[email protected]"). Text you enter goes into escaped JavaScript string literals. If a selector contains double quotes, such as button[type="submit"], the tool switches to single quotes so the line still parses. The Options field takes an object body like timeout: 10000, and the braces are added for you. The network steps follow the Cypress docs. An intercept step accepts a plain URL or a method and path, so "get /api/users" becomes cy.intercept("GET", "/api/users", ...) with the method uppercased. The Selector field supplies the alias, and a blank one falls back to apiCall. A wait step with getUsers produces cy.wait("@getUsers"), while a bare number like 500 becomes a millisecond wait. Assertions get the same care. A should step uses Value as the chainer and Options as the expected value. Numbers, booleans and null stay unquoted, so have.length with 3 gives should("have.length", 3) and compares against a real number. An and step is glued onto the should line before it. If there is no should to attach to, you get a comment instead. That comment habit runs through the whole tool. A click with no selector turns into "// click: enter a selector" rather than cy.get(""). Ticking Generate as Custom Command wraps the steps in Cypress.Commands.add for cypress/support/commands.js and adds a spec that calls it. A command name that is not a valid JavaScript identifier falls back to myCommand. Limits are worth knowing up front. Each step is a separate cy.get, so find only chains onto its own get, not onto a previous step. There is no beforeEach, no fixtures file and no TypeScript declaration for custom commands. Treat the output as a clean starting draft, then tidy it in your editor.
Frontend developers and QA engineers new to Cypress who want a correct first spec or custom command without looking up every method signature. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Cypress Command Builder
- Type a Test Suite Name. It becomes the describe() title.
- Click Add Step for each action and pick it from the Action dropdown. The hint under the step explains what Selector, Value and Options mean for that action.
- Fill in Selector, Value and Options. Leave Options blank unless you need something like timeout: 10000 or log: false.
- Delete steps you don't need with the trash icon. At least one step always stays.
- Tick Generate as Custom Command and enter a name if you want a reusable command instead of a plain spec.
- Copy the Generated Code into a file under cypress/e2e, or split the custom command part into cypress/support/commands.js.
03Worked examples
- Input:
Steps: cy.visit() /login; .type() on #email with [email protected]; .click() on button[type="submit"] - Result:
describe("Login", () => { it("completes the flow", () => { cy.visit("/login"); cy.get("#email").type("[email protected]"); cy.get('button[type="submit"]').click(); }); }); - When a selector contains double quotes, the tool switches to single quotes so the code stays valid.
- Input:
Steps: cy.intercept() value 'get /api/users', selector getUsers, options fixture: "users.json"; cy.wait() getUsers; .should() on .row have.length 3; .and() be.visible - Result:
cy.intercept("GET", "/api/users", { fixture: "users.json" }).as("getUsers"); cy.wait("@getUsers"); cy.get(".row").should("have.length", 3).and("be.visible"); - The method is uppercased, the @ is added to the wait alias, 3 stays a number, and .and() is chained onto the previous .should() line.
- Input:
Steps: cy.visit() /login; .type() on #pw with secret{enter}, options log: false; Custom command on, name login - Result:
// cypress/support/commands.js Cypress.Commands.add("login", () => { cy.visit("/login"); cy.get("#pw").type("secret{enter}", { log: false }); }); // cypress/e2e/spec.cy.js describe("Auth", () => { it("runs the login command", () => { cy.login(); }); }); - Options are wrapped in braces for you; log: false keeps the typed value out of the command log.
- Input:
Steps: .and() be.visible (first step); .click() with no selector; cy.wait() 500 - Result:
// .and() must follow a .should() step // click: enter a selector cy.wait(500); - Incomplete steps become comments instead of broken code, and a number in cy.wait() becomes a millisecond wait.
- Input:
Custom command on, name bad-name, one step cy.visit() / - Result:
Cypress.Commands.add("myCommand", () => { cy.visit("/"); }); … cy.myCommand(); - Trimmed to the command and the call. A name that isn't a valid JavaScript identifier falls back to myCommand, because cy.bad-name() would not run.
- Input:
Steps: .check() on [name="terms"]; cy.get() on [data-cy=row] with options timeout: 10000; cy.intercept() value /api/* with options statusCode: 500, no alias - Result:
cy.get('[name="terms"]').check(); cy.get("[data-cy=row]", { timeout: 10000 }); cy.intercept("/api/*", { statusCode: 500 }).as("apiCall"); - Only the body lines are shown. A blank alias on an intercept defaults to apiCall.
04Common use cases
- Sketching a login spec with visit, type and click steps for a new React app before the real suite exists
- Stubbing a GET /api/users call with a fixture and waiting on its alias instead of a hard-coded sleep
- Turning a repeated login flow into a Cypress.Commands.add block for cypress/support/commands.js
- Showing a junior QA engineer how queries, actions and assertions chain, using the three loaded examples
- Drafting a contact form test with select, check and a should/and assertion pair on the success message
- Forcing an error state by intercepting /api/* with statusCode: 500 to see how the UI reacts
05Tips
- Put log: false in the Options of a password type step. Cypress then keeps the typed value out of the command log.
- Type {enter} at the end of a Value to submit a form from the keyboard. Cypress treats curly-brace sequences as special keys.
- Wait on an intercept alias rather than a number. Cypress already retries queries and assertions for up to four seconds by default, so fixed sleeps mostly add time.
- If your project uses TypeScript, declare custom commands in a .d.ts file. Otherwise cy.login() will show a type error even though it runs.
- Prefer data-cy or data-testid selectors over CSS classes, so a styling change does not break the test.
06Related concepts
Cypress, End-to-end testing, cy.intercept, Custom commands, Test selectors.
Frequently Asked Questions
What is Cypress Command Builder?
Cypress Command Builder is a free, browser-based developer tool on AIDToolStack. Build Cypress test commands It requires no installation or sign-up and works entirely in your browser.
Is Cypress Command Builder free to use?
Yes. No sign-up, no fees and no usage cap.
Does Cypress Command Builder store my data?
No. It runs in your browser; nothing is uploaded.