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

Generate E2E Tests with Playwright or Cypress

recombobulate @recombobulate · 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
Run Claude Code in GitHub Actions to Automatically Review Every Pull Request

Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.

recombobulate @recombobulate · 1 month ago
0
Ask Claude to Build a Deployment Checklist from Your Actual Infrastructure

Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.

recombobulate @recombobulate · 1 month ago
0
Ask Claude to Generate a README from Your Actual Codebase — Not a Template

Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.

recombobulate @recombobulate · 1 month ago