home / skills / ehtbanton / claudeskillsrepo / cypress-test-generator

cypress-test-generator skill

/cypress-test-generator

This skill generates Cypress configuration and sample end-to-end tests for a web app, accelerating test setup and ongoing QA work.

npx playbooks add skill ehtbanton/claudeskillsrepo --skill cypress-test-generator

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
990 B
---
name: cypress-test-generator
description: Generate Cypress E2E test files and configuration for web application testing. Triggers on "create cypress test", "generate cypress config", "e2e test for", "cypress setup".
---

# Cypress Test Generator

Generate Cypress E2E test files and configuration for comprehensive web application testing.

## Output Requirements

**File Output:** `cypress.config.ts`, `cypress/e2e/*.cy.ts`
**Format:** Valid Cypress configuration and test files
**Standards:** Cypress 13.x

## When Invoked

Immediately generate Cypress configuration and sample test files for the specified application.

## Configuration Template

```typescript
import { defineConfig } from 'cypress';

export default defineConfig({
  e2e: {
    baseUrl: 'http://localhost:3000',
    supportFile: 'cypress/support/e2e.ts',
  },
});
```

## Example Invocations

**Prompt:** "Create cypress config and login test"
**Output:** Complete `cypress.config.ts` and `cypress/e2e/login.cy.ts`.

Overview

This skill generates Cypress 13.x configuration and end-to-end test files for web applications. It produces a ready-to-run cypress.config.ts and one or more cypress/e2e/*.cy.ts test files based on a short prompt. The output targets practical flows like login, navigation, form submission, and basic assertions so tests can be run locally or in CI immediately.

How this skill works

Given a trigger phrase or brief description, the skill creates a valid cypress.config.ts and example test files under cypress/e2e. It follows Cypress 13.x conventions, sets a baseUrl and supportFile, and scaffolds tests with clear selectors and realistic step sequences. Files are emitted as complete TypeScript modules so they can be dropped into a project and executed with minimal edits.

When to use it

  • Set up Cypress for a new project quickly
  • Add sample E2E tests for common flows (login, signup, checkout)
  • Generate configuration and starter tests for CI integration
  • Create reproducible test scaffolding for manual refinement
  • Provide examples during code reviews or onboarding

Best practices

  • Provide the app base URL and primary flows in the prompt for targeted tests
  • Prefer stable selectors (data-* attributes) and mention them when possible
  • Limit generated tests to one focused scenario per file for clarity
  • Run tests locally first, then add fixtures and network stubbing as needed
  • Iterate on generated tests to match actual DOM and auth flows

Example use cases

  • Create cypress.config.ts and a login.cy.ts that logs in, asserts dashboard elements, and logs out
  • Generate tests for a checkout flow: add item, fill address, complete payment (stubbed), assert order confirmation
  • Produce E2E tests for a signup flow including validation errors and success redirect
  • Scaffold cypress.config.ts plus multiple .cy.ts files for navigation, search, and profile editing
  • Create initial Cypress setup for CI with baseUrl and supportFile references

FAQ

What files does this skill output?

It outputs a complete cypress.config.ts and one or more cypress/e2e/*.cy.ts TypeScript test files.

Which Cypress version does it target?

Generated files follow Cypress 13.x configuration and syntax.