Skip to content

A simple way to get started E2E tests for websites with Claude Code

Notifications You must be signed in to change notification settings

gluk-w/claude-code-e2e-tests-boilerplate

Repository files navigation

Boilerplate for E2E tests with Claude Code

A simple way to get started E2E tests for websites with Claude Code. This boilerplate contains

Prerequisites

  • Node.js 18 or higher
  • npm (Node Package Manager)
  • Active billing account with Anthropic or Claude Max subscription

Claude Code

If you haven't already, install Claude Code and complete the one-time OAuth process with your Claude Max or Anthropic Console account

npm install -g @anthropic-ai/claude-code

Installation

claude -p "Setup the project"

Writing tests

Open claude and tell it what you want to be tested. The best strategy is to supply a numbered list of step. E.g.

1. Open clutch.co
2. Select a service from the "Search web developers, SEO, UX..." dropdown 
3. Make sure locations are populated in the "Any location"
4. Pick the first location from "Nearby locations" section of the dropdown and note its name
5. Click "Get Started"
6. Make sure you are redirected to the webpage for that service line and location

Claude Code will start analyzing the web page using Playwright MCP, guess what elements it needs to interact with, generate test code and run it until all checks pass. Just approve the commands when prompted and review the results after a few minutes.

Best practices

...

Contributions

Pull requests are welcome!

About

A simple way to get started E2E tests for websites with Claude Code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published