Skip to main content

Cypress E2E Test Generator

Build Cypress E2E tests step by step. Set your base URL and test name, add actions — then copy or download the generated .cy.js file directly into your project.

✓ visit/click/type/assert/wait/intercept ✓ Full describe/it structure ✓ Download as .cy.js ✓ Copy to clipboard

Generated Test File

 
Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →

Frequently Asked Questions

What is Cypress and how is it different from Playwright?▼

Cypress is a JavaScript E2E testing framework that runs directly inside the browser, giving it unique access to browser APIs, DOM, and network layer. It features real-time reloading, time-travel debugging, and automatic waiting. Playwright runs outside the browser and supports multiple browsers (Chrome, Firefox, Safari) cross-platform. Cypress is generally easier to start with; Playwright is more powerful for multi-browser testing.

What does cy.intercept() do?▼

cy.intercept() lets you intercept and stub HTTP requests made by your app. You can match by method and URL, return mock responses, and assert on request/response data. This is essential for testing API-dependent flows without hitting real backends. Example: cy.intercept('GET', '/api/users', { fixture: 'users.json' }).as('getUsers')

How does Cypress handle asynchronous operations?▼

Cypress automatically waits for commands to complete and has built-in retry logic for assertions. You don't need explicit waits for DOM elements — cy.get() retries until the element appears or times out. Use cy.wait('@alias') to wait for a specific network request to complete. Avoid arbitrary cy.wait(1000) delays.

What is the best way to select elements in Cypress tests?▼

The recommended approach is to add 'data-cy' (or 'data-testid') attributes to elements in your HTML specifically for testing. Example: <button data-cy='submit-btn'>. Then use cy.get('[data-cy=submit-btn]'). This decouples tests from styling and structure changes. Avoid selecting by CSS classes or text content as they change frequently.

Where do I put Cypress test files?▼

By default, Cypress looks for E2E tests in 'cypress/e2e/' with the pattern '**/*.cy.{js,jsx,ts,tsx}'. For component tests it uses 'cypress/component/'. You can customize these paths in cypress.config.js. The generated .cy.js file from this tool should be placed in your 'cypress/e2e/' directory.

How do I run Cypress tests in CI?▼

Use 'npx cypress run' for headless execution in CI. Add '--browser chrome' to specify the browser, '--spec cypress/e2e/mytest.cy.js' to run a specific file, and '--record' with the CYPRESS_RECORD_KEY environment variable to record results to Cypress Cloud. The Cypress GitHub Action (cypress-io/github-action) handles caching and parallelization automatically.