Self-Test Skill
IMPORTANT: Do NOT explore the codebase. Do NOT read source files, package.json, or project structure. Go directly to Step 1. Simple E2E tests should complete under $0.50.
Spin up a separate test Clawd instance and run E2E tests against it using Playwright.
CRITICAL: Do NOT navigate to clawd:4000 or any parent instance URL. You must spin up your OWN test instance using the script below and test against THAT.
Step 1: Spin Up a Test Instance
Detect the current branch and launch the test instance:
bash
BRANCH=$(git -C /workspace branch --show-current 2>/dev/null || echo "main") echo "Testing branch: $BRANCH" bash /workspace/scripts/test-clawd.sh --branch "$BRANCH"
- •The script outputs the test instance URL (e.g.
http://test-clawd-1234567890:5000) and container name - •Login credentials are
test/test - •Wait for the script to confirm the instance is ready before proceeding
Step 2: Run E2E Tests with Playwright MCP
Use the Playwright MCP browser tools to test the instance from Step 1:
- •Navigate to the test instance URL (from Step 1 output) with
browser_navigate - •Log in with
test/test - •Use
browser_snapshotto inspect page state (preferred over screenshots) - •Interact with elements using
browser_click,browser_type,browser_fill_form - •Assert conditions by inspecting snapshots
Tips:
- •The test instance has no
project-repos.json, so the New Session dialog shows raw URL + branch inputs instead of the repository dropdown - •
PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsersis already set - •Test sessions can use
dangerouspermission mode to avoid approval dialog friction during E2E tests
Step 3: Clean Up
When testing is complete, always clean up:
bash
bash /workspace/scripts/cleanup-test-clawd.sh <container-name>
Step 4: Report Results
Summarize which tests passed/failed, any errors encountered, and snapshots of failures.
Test Recipes
Recipe: Verify Plan Markdown View
- •Create a new session (any repo,
auto_editsmode) - •Send: "Enter plan mode and write a short 3-bullet plan for adding a README"
- •Wait for the plan card to appear in the chat
- •Click the plan card to open the full-screen overlay
- •Assert: overlay is visible, contains markdown content, has a close button
- •Close the overlay and assert it's dismissed
Recipe: Verify Session Creation
- •Click "New Session" from the session list
- •Fill in a repo URL (e.g.
https://github.com/octocat/Hello-World), branchmaster, permission modenormal - •Submit the form
- •Assert: session appears in the list, status transitions to "running"
- •Send a simple message like "What files are in this repo?" and verify a response appears
Recipe: Verify Skill Invocation
- •Create a new session (any repo,
auto_editsmode) - •Type
/in the input to trigger the skill picker - •Assert: skill options appear (e.g. "wrapup")
- •Select a skill and verify it loads into the input
Troubleshooting
- •If the test instance takes too long to start, check logs:
docker logs <container-name> - •Test instances run on port 5000 within the Docker network — not exposed to the host
- •Each test instance gets a unique name based on timestamp, so multiple can coexist