Playwright MCP server has been installed and configured in this project.
Location: .mcp.json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@executeautomation/playwright-mcp-server"],
"env": {
"PLAYWRIGHT_BROWSERS_PATH": "/Users/annhoward/.cache/ms-playwright"
}
}
}
}After restarting Claude Code, the Playwright MCP tools will be automatically available.
Once loaded, you'll have access to Playwright MCP tools for:
Browser Automation:
playwright_navigate- Navigate to URLsplaywright_screenshot- Take screenshotsplaywright_click- Click elementsplaywright_fill- Fill form fieldsplaywright_select- Select dropdown optionsplaywright_evaluate- Execute JavaScript
Testing:
playwright_expect- Assertions for testingplaywright_waitFor- Wait for elements/conditionsplaywright_getElement- Find elements by selector
After restart, you can ask Claude to:
"Navigate to http://localhost:3000 and take a screenshot"
"Click the login button and fill in the username field"
"Test the registration flow and verify success message"
"Navigate through the app and document all pages with screenshots"
cd /Users/annhoward/src/solarpunk_utopia/frontend
npm run dev-
User Registration Flow
Navigate to http://localhost:3000/register Fill in username: "test_user" Fill in email: "test@example.com" Click submit button Verify success message appears Take screenshot -
Agent Dashboard
Navigate to http://localhost:3000/agents Wait for agents to load Take screenshot of each agent card Click on first agent Verify agent details display -
Offer/Need Creation
Navigate to http://localhost:3000/offers/create Fill in offer details Click submit Verify offer appears in list Take screenshot of confirmation
After restart, you can ask Claude to:
"Test the complete user journey:
1. Register new user
2. Create an offer
3. Browse community offers
4. Match with a need
5. Complete exchange
6. Take screenshots at each step"
"Take screenshots of all main pages:
- Homepage
- Login
- Dashboard
- Agents page
- Offers page
- Needs page
- Settings
Save them to /screenshots/ folder for comparison"
"Navigate through the app and check:
- All buttons have aria-labels
- Forms have proper labels
- Color contrast ratios
- Keyboard navigation works
- Screen reader friendly markup"
To use Firefox or WebKit instead of Chromium, update .mcp.json:
{
"env": {
"PLAYWRIGHT_BROWSER": "firefox" // or "webkit"
}
}By default, Playwright runs in headless mode. To see the browser:
{
"env": {
"PLAYWRIGHT_HEADLESS": "false"
}
}- Restart Claude Code - MCP servers only load on startup
- Check .mcp.json syntax - Ensure valid JSON
- Verify npx works:
npx -y @executeautomation/playwright-mcp-server - Check browser installation:
npx playwright install chromium
If you get permission errors:
chmod +x node_modules/.bin/playwrightReinstall browsers:
npx playwright install --forceUse Playwright MCP to verify:
- ✅ All pages load without errors
- ✅ Forms submit successfully
- ✅ Navigation works across app
- ✅ Responsive design on mobile/tablet/desktop
- ✅ Error messages display correctly
- ✅ Loading states work
- ✅ Authentication flow complete
- Screenshot Tour: Generate screenshots of every feature for documentation
- Flow Validation: Test each user journey end-to-end
- Visual Consistency: Check design system across all pages
- Cross-Browser: Test on Chromium, Firefox, WebKit
- Performance: Measure page load times
Your existing Pytest tests cover:
- Backend API endpoints
- Database operations
- Business logic
- Integration flows
Playwright MCP adds:
- Frontend UI interactions
- Visual regression
- User experience flows
- Cross-browser compatibility
- Accessibility compliance
Backend (Pytest):
# tests/test_governance_silence_weight.py
def test_create_vote_session():
# Test API directly
passFrontend (Playwright MCP):
Navigate to governance page
Create new vote via UI
Verify vote appears in list
Check silence weight displays
- Restart Claude Code to load Playwright MCP
- Start your frontend:
cd frontend && npm run dev - Ask Claude to test: "Navigate to localhost:3000 and test the login flow"
- Generate screenshots: "Take screenshots of all pages for documentation"
- Test user flows: "Test the complete offer creation and matching flow"
- Playwright Docs: https://playwright.dev
- MCP Server: https://github.com/executeautomation/mcp-playwright
- This Project's Frontend:
/Users/annhoward/src/solarpunk_utopia/frontend/
Ready for comprehensive UI testing after restart! 🎭