# chrome-extension-testing
> Test Chrome extensions with stealth automation on bot-protected sites. Use when testing extensions on X.com, LinkedIn, or other sites with CDP detection. Provides cross-script logging, screenshot capture, and HTML analysis. Handles isolated world communication.
- Author: Matt Brooks
- Repository: MattB543/claude-skills
- Version: 20251206162038
- Stars: 0
- Forks: 0
- Last Updated: 2026-02-07
- Source: https://github.com/MattB543/claude-skills
- Web: https://mule.run/skillshub/@@MattB543/claude-skills~chrome-extension-testing:20251206162038
---
---
name: chrome-extension-testing
description: Test Chrome extensions with stealth automation on bot-protected sites. Use when testing extensions on X.com, LinkedIn, or other sites with CDP detection. Provides cross-script logging, screenshot capture, and HTML analysis. Handles isolated world communication.
---
# Chrome Extension Testing
Test Chrome extensions using rebrowser-playwright (stealth Playwright fork) with cross-script logging and comprehensive reporting.
## CRITICAL: Agent Workflow Requirements
**BEFORE starting any test:**
1. Check if `test-reports/` folder exists in the target project. If not, create it.
2. Each test run MUST create a unique subfolder: `test-reports/{timestamp}_{test-name}/`
**AFTER every test run, the agent MUST:**
1. **View ALL screenshots** - Use the Read tool to view every PNG in the test report folder. Verify all visuals look correct (UI elements rendered properly, no broken layouts, extension elements visible where expected).
2. **Read the logs** - Open `console-logs.md` and verify logs look correct (no unexpected errors, expected actions logged, timing makes sense).
3. **Confirm report completeness** - Ensure the test folder contains:
- All numbered screenshots (`01_*.png`, `02_*.png`, etc.)
- `console-logs.md` with extension and page console logs
- `full-page.html` with complete page HTML
**About the saved HTML files:**
The HTML files (`full-page.html`, `element-contexts.html`) are saved for **on-demand debugging only**. They should be grepped or read when:
- Verifying the DOM state at a specific test step
- Checking for HTML errors or malformed markup
- Understanding the structure of the page to improve selectors or injection logic
- Debugging why an element wasn't found or looks wrong
Do NOT read HTML files routinely - only when investigating issues or when the visual screenshots show problems that need DOM-level analysis.
## Quick Reference
| Task | Method |
|------|--------|
| Set up test env | Run `scripts/init-test-env.js` or copy assets manually |
| Add logging | Copy `assets/logger.js` to extension's `shared/` folder |
| Write test | Use `assets/test-template.ts` as starting point |
| Run tests | `npm run test:stealth` |
| Manual login | `npm run login` (saves session to .test-profile/) |
| Zoom screenshot | `node scripts/zoom-screenshot.js