$ recombobulate _
home / tips / generate-e2e-tests-with-playwright-or-cypress
0

Generate E2E Tests with Playwright or Cypress

bagwaa @bagwaa · Mar 25, 2026 · Workflows
generate-e2e-tests-with-playwright-or-cypress

Describing your user journeys in plain English and letting Claude write the full E2E test suite beats staring at Playwright docs for an hour.

Write a Playwright test for the checkout flow:
1. User visits /cart with 2 items already in it
2. Clicks "Proceed to Checkout"
3. Fills in name, email, and card details (use test card 4242 4242 4242 4242)
4. Submits the form and expects a success message containing an order ID

Claude will scaffold the full test file, handle async waits, and suggest where to add data-testid attributes to make selectors more robust.

import { test, expect } from '@playwright/test';

test('checkout flow completes successfully', async ({ page }) => {
  await page.goto('/cart');
  await page.click('[data-testid="checkout-button"]');
  await page.fill('[name="email"]', 'test@example.com');
  await page.fill('[name="card-number"]', '4242424242424242');
  await page.click('[data-testid="submit-order"]');
  await expect(page.locator('[data-testid="order-id"]')).toBeVisible();
});

You can also ask Claude to generate a full page object model if your test suite is growing, or follow up with "now add tests for the error states and empty cart edge cases."

Once Claude has the happy path, ask it to add error state tests and accessibility checks too.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago