Claude Code - Playwright

From Logic Wiki
Jump to: navigation, search


Setup

Prompt :

set up playwright with a seperate database for testing. Don't write any tests. Just do the setup and do the configuration.

Check new database and see if everything ok. If Seedings are missing write this prompt :

the seed script for adding the admin user was not executed

If rate limiting applied disable for test env.

enable rate limiting only in production environment

Creating Testing Agent

/agents

Create new agent -> Generate with Claude

Prompt :

write e2e tests using playwright

it creates e2e-test-writer.md and then

move the testing instructions from claude.md to e2e-test-writer

to individually create the tests we have to write prompt like :

use e2e-test-writer to write tests for the login page 

to make it more practical

update claude.md. Add instructions for using e2e-test-writer for writing tests

Writing and Running e2e tests

Prompt :

write e2e tests for the authentication system. cover all scenarios and edge cases

to run tests in terminal

bun run test:e2e 

or

bun run test:e2e:ui

Reviewing e2e tests

test-results directory is created in the root. it should be under e2e