Chrome Extension CI/CD Testing - Research Summary
π Documentation Overview
This research package contains everything needed to implement automated regression testing for EchoKit Chrome extension in CI/CD.
π Documents in This Package
1. CHROME_EXTENSION_CI_CD_TESTING_RESEARCH.md (Comprehensive Research)
- Purpose: Complete research findings from 2026 sources
- Audience: Technical decision makers, architects
- Read time: 20-30 minutes
- Contains:
- Testing framework analysis (Playwright, Puppeteer, Selenium)
- Headless mode challenges & solutions
- Test pyramid strategy (70/20/10)
- Visual regression testing options
- 4-phase implementation plan
- Success metrics and KPIs
- Troubleshooting guide
Read this if: You want deep understanding of all options
2. CI_CD_IMPLEMENTATION_GUIDE.md (Step-by-Step Guide)
- Purpose: Practical implementation instructions
- Audience: Developers implementing the changes
- Read time: 15-20 minutes
- Contains:
- Exact code changes needed for Phase 1 (CI fixes)
- GitHub Actions workflow updates
- Branch protection setup
- Unit testing with Vitest (Phase 2)
- Visual regression implementation (Phase 3)
- Testing checklist
- Troubleshooting common issues
Read this if: Youβre ready to implement and need step-by-step instructions
3. TESTING_FRAMEWORK_COMPARISON.md (Technical Comparison)
- Purpose: Detailed framework comparison and benchmarks
- Audience: Engineers evaluating alternatives
- Read time: 10-15 minutes
- Contains:
- Side-by-side framework matrix
- Detailed Playwright/Puppeteer/Selenium analysis
- Code examples for each framework
- Performance benchmarks
- Cost analysis (free vs paid tools)
- Common pitfalls and solutions
- Decision matrix
Read this if: You need to justify framework choice or want alternatives
π― Quick Start (For Busy Developers)
Goal: Get regression tests running in CI/CD ASAP
Minimum Viable Implementation (2-3 hours)
- Update
tests/smoke_echokit.py (5 minutes)
# Change line ~102
context = p.chromium.launch_persistent_context(
"",
channel='chromium', # β Add this
headless=True, # β Change to True
args=[...]
)
- Update
.github/workflows/test.yml (10 minutes)
- Remove
if: false from smoke job
- Simplify to just install Playwright and run tests
- See
CI_CD_IMPLEMENTATION_GUIDE.md section βStep 2β for exact code
- Enable Branch Protection (5 minutes)
- GitHub β Settings β Branches
- Add rule for
develop
- Require
smoke and validate checks
- See
CI_CD_IMPLEMENTATION_GUIDE.md section βStep 3β for screenshots
- Test It (10 minutes)
- Create test branch
- Make trivial change
- Push and create PR
- Verify tests run and block merge if failing
Total time: ~30 minutes + CI runtime
Result: Automated regression tests blocking bad PRs β
π Recommended Reading Order
For Product/Engineering Managers
- Read executive summary in
CHROME_EXTENSION_CI_CD_TESTING_RESEARCH.md
- Review Phase 1 plan (fix CI pipeline)
- Check success metrics table
- Decide: Approve Phase 1 implementation?
Time investment: 10 minutes
For Developers (Implementing)
- Skim
CHROME_EXTENSION_CI_CD_TESTING_RESEARCH.md for context
- Focus on
CI_CD_IMPLEMENTATION_GUIDE.md
- Follow Phase 1 step-by-step
- Use Troubleshooting section when stuck
- Reference
TESTING_FRAMEWORK_COMPARISON.md for framework-specific issues
Time investment: 30 minutes reading + 2-3 hours implementing
For QA/Test Engineers
- Read Test Pyramid section in research doc
- Review Visual Regression options (Phase 3)
- Study Troubleshooting in implementation guide
- Design additional test cases using examples
Time investment: 45 minutes
π Implementation Phases
Phase 1: Fix CI Pipeline (PRIORITY β)
- Effort: 2-3 hours
- Risk: Low
- Benefit: Immediate - blocks broken code from merging
- Files:
tests/smoke_echokit.py, .github/workflows/test.yml
- Guide:
CI_CD_IMPLEMENTATION_GUIDE.md β Phase 1
Phase 2: Add Unit Tests (Recommended)
- Effort: 1-2 days
- Risk: Low
- Benefit: 10x faster feedback (seconds vs minutes)
- Files: New
tests/unit/*.test.js, vitest.config.js
- Guide:
CI_CD_IMPLEMENTATION_GUIDE.md β Phase 2
Phase 3: Visual Regression (Optional)
- Effort: 4-6 hours
- Risk: Medium (baseline management)
- Benefit: Catches UI bugs automatically
- Files: New
tests/visual_regression.py
- Guide:
CI_CD_IMPLEMENTATION_GUIDE.md β Phase 3
Phase 4: Integration Tests (Future)
- Effort: 2-3 days
- Risk: Medium
- Benefit: Tests message passing, Chrome APIs
- Status: Planned, not yet documented
- When: After Phase 1-3 stable for 1 month
β
Decision Checklist
Use this to verify you have everything needed:
Technical Decisions β
Process Decisions β
Resource Allocation β
π― Success Metrics (Track These)
Week 1
Month 1
Quarter 1 (if doing Phase 2-3)
π¨ Red Flags (Stop and Reassess)
Stop Phase 1 if:
- Tests fail in CI but pass locally for >1 week
- Test runtime exceeds 5 minutes
- More than 10% flakiness rate
- Developers bypass tests regularly
Action: Debug with HEADLESS=false locally, check Troubleshooting sections
Stop Phase 2 if:
- Unit tests take > 30 seconds
- Mocking Chrome APIs is too complex
- Coverage doesnβt improve after 2 weeks
Action: Focus on E2E tests only, revisit unit tests later
Stop Phase 3 if:
- Visual tests constantly fail due to minor diffs
- Baseline management becomes burdensome
- Team canβt agree on acceptable diff threshold
Action: Consider Percy.io (paid service) or skip visual testing
π Getting Help
Internal Resources
- Existing tests:
tests/smoke_echokit.py (working example)
- Current CI:
.github/workflows/test.yml (baseline)
- Extension architecture:
extension/README.md
External Resources
- Playwright Docs: https://playwright.dev/docs/chrome-extensions
- Chrome Testing Guide: https://developer.chrome.com/docs/extensions/how-to/test
- Community Template: https://github.com/kelseyaubrecht/playwright-chrome-extension-testing-template
Common Questions
Q: Can we skip tests for hotfixes?
A: No. Tests are especially critical for hotfixes. Use feature flags instead.
Q: What if tests are slow?
A: Target breakdown: unit tests <10s, integration <30s, E2E <2min. Optimize E2E first.
Q: Do we need all 3 phases?
A: Phase 1 is required. Phase 2-3 are recommended but optional.
π¬ Next Steps
- Today: Review this summary, decide on Phase 1 timeline
- This Week: Implement Phase 1 (fix CI pipeline)
- This Month: Monitor stability, plan Phase 2 if desired
- This Quarter: Reach 40%+ test coverage, zero blank screen bugs
π Files Modified (Phase 1)
echokit/
βββ tests/
β βββ smoke_echokit.py # Update: add channel='chromium'
βββ .github/
β βββ workflows/
β βββ test.yml # Update: remove if: false
βββ [GitHub Settings] # Update: branch protection rules
No new files needed for Phase 1! Just modify existing files.
Ready to implement? β Start with CI_CD_IMPLEMENTATION_GUIDE.md
Need more context? β Read CHROME_EXTENSION_CI_CD_TESTING_RESEARCH.md
Evaluating alternatives? β Check TESTING_FRAMEWORK_COMPARISON.md
Last Updated: 2026-05-12
Estimated Total Implementation Time: 2-3 hours (Phase 1 only)
Estimated ROI: 10x reduction in production bugs after 1 month