| name | frontend-testing |
| description | Test web applications using Chrome DevTools. Use for visual regression testing, performance analysis, accessibility checks, console error detection, and automated UI testing. Works with live URLs or local development servers. |
Frontend Testing Skill
Purpose
Automate frontend testing using Chrome DevTools Protocol to verify UI functionality, performance, and correctness.
When to Use This Skill
- Testing UI components in a browser
- Checking for console errors or warnings
- Performance profiling of web pages
- Visual regression testing with screenshots
- Automated user flows (clicking, typing, form filling)
- Network request validation
- Accessibility testing
Instructions
1. Basic Page Testing
- Use
navigate_pageto load the target URL - Use
wait_forto ensure page is ready (e.g., wait for specific elements) - Use
take_screenshotto capture the current state - Use
list_console_messagesto check for errors or warnings
2. Performance Testing
- Use
performance_start_tracebefore loading the page - Navigate to the target URL
- Use
performance_stop_traceto capture metrics - Use
performance_analyze_insightto get actionable insights
3. Interactive Testing
- Use
clickto interact with buttons or links - Use
fillorfill_formto test form inputs - Use
press_keyfor keyboard interactions - Use
hoverto test hover states - Take screenshots after each interaction to verify state changes
4. Network Testing
- Navigate to the page
- Use
list_network_requeststo see all requests - Use
get_network_requestto inspect specific requests - Verify API responses, status codes, and timing
5. Multi-Page Testing
- Use
new_pageto open additional tabs - Use
list_pagesto see all open tabs - Use
select_pageto switch between tabs - Use
close_pagewhen done
Best Practices
- Always wait for page load before interacting (
wait_for) - Take screenshots before and after interactions for debugging
- Check console messages after page load to catch JavaScript errors
- Use meaningful filenames for screenshots (include timestamp or test name)
- Clean up by closing pages when tests are complete
Common Testing Patterns
Pattern: Basic Smoke Test
1. Navigate to URL
2. Wait for page load
3. Check console for errors
4. Take screenshot
5. Report results
Pattern: Form Submission Test
1. Navigate to form page
2. Fill form fields using `fill_form`
3. Take screenshot of filled form
4. Click submit button
5. Wait for response/redirect
6. Verify success message or URL change
7. Check console for errors
Pattern: Performance Audit
1. Start performance trace
2. Navigate to URL
3. Wait for page to fully load
4. Stop performance trace
5. Analyze trace for insights
6. Report metrics (LCP, FID, CLS, etc.)
Example Usage
User: "Test the homepage at localhost:3000" Response: Navigate, wait for load, check console, take screenshot, report findings
User: "Profile the performance of example.com" Response: Start trace, navigate, stop trace, analyze, report metrics
User: "Test the login flow with credentials test@example.com / password123" Response: Navigate to login, fill form, submit, verify redirect, check for errors