home / skills / openclaw / skills / ai-e2e-gen

ai-e2e-gen skill

/skills/lxgicstudios/ai-e2e-gen

This skill generates Playwright or Cypress end-to-end tests from user flows, including waits, assertions, and data-testid selectors.

npx playbooks add skill openclaw/skills --skill ai-e2e-gen

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

Files (2)
SKILL.md
1.3 KB
---
name: e2e-gen
description: Generate Playwright/Cypress E2E tests from user flows
---

# E2E Test Generator

Describe user flows, get Playwright or Cypress tests. No more writing login tests by hand.

## Quick Start

```bash
npx ai-e2e-gen "User signs up, verifies email, completes onboarding"
```

## What It Does

- Converts flow descriptions to E2E tests
- Generates Playwright or Cypress code
- Includes proper waits and assertions
- Adds data-testid selectors

## Usage Examples

```bash
# Generate Playwright test
npx ai-e2e-gen "User adds item to cart and checks out"

# Generate Cypress test
npx ai-e2e-gen "Admin creates new user" --framework cypress

# From existing page
npx ai-e2e-gen --url http://localhost:3000/dashboard
```

## Output Example

```typescript
test('user completes checkout', async ({ page }) => {
  await page.goto('/products');
  await page.click('[data-testid="add-to-cart"]');
  await page.click('[data-testid="checkout"]');
  await expect(page.locator('.success')).toBeVisible();
});
```

## Requirements

Node.js 18+. OPENAI_API_KEY required.

## License

MIT. Free forever.

---

**Built by LXGIC Studios**

- GitHub: [github.com/lxgicstudios/ai-e2e-gen](https://github.com/lxgicstudios/ai-e2e-gen)
- Twitter: [@lxgicstudios](https://x.com/lxgicstudios)

Overview

This skill generates Playwright or Cypress end-to-end tests from plain-language user flows. It turns flow descriptions or a target URL into ready-to-run test files with selectors, waits, and assertions. It aims to eliminate manual boilerplate for login, checkout, onboarding, and common user journeys.

How this skill works

Describe the user flow as a short sentence or provide a page URL and the tool outputs framework-specific test code. It maps actions to data-testid selectors, inserts appropriate waits and assertions, and formats tests for Playwright or Cypress. You can switch frameworks via a flag and supply environment settings like base URL and API key when required.

When to use it

  • Rapidly scaffold E2E tests from product or QA acceptance criteria
  • Seed test suites for new features such as signup, checkout, or admin flows
  • Convert manual test cases into automated Playwright or Cypress tests
  • Create reproducible examples for CI pipelines and developer onboarding
  • Generate tests for prototype or local development servers using a URL

Best practices

  • Write concise, step-by-step flow descriptions focused on user intent
  • Prefer stable data-testid attributes in the application for reliable selectors
  • Verify test output and adapt selectors if the app uses dynamic IDs
  • Use generated tests as a starting point—refine waits and authentication for CI
  • Keep Node.js updated to the required version and secure your API keys

Example use cases

  • npx ai-e2e-gen "User signs up, verifies email, completes onboarding" to create a Playwright test
  • Generate a Cypress admin flow: npx ai-e2e-gen "Admin creates new user" --framework cypress
  • Create checkout tests from natural language: npx ai-e2e-gen "User adds item to cart and checks out"
  • Point to a running app for contextual tests: npx ai-e2e-gen --url http://localhost:3000/dashboard
  • Seed CI test suites quickly when launching a new product area

FAQ

Which frameworks are supported?

Playwright and Cypress are supported. You can choose the framework with a flag; default output is Playwright.

What are the system requirements?

Node.js 18+ is required. An OpenAI API key (OPENAI_API_KEY) is needed for natural language conversion.