[EXPERIMENTAL] feat: #3608871 Ship a self-contained Playwright runtime under js/
EXPERIMENTAL
This is an experimental test MR that may or may not work in every environment. It ships a self-contained Playwright runtime as an opt-in js/ layout; if provisioning fails on a given host, the runner degrades gracefully and falls back to whatever Playwright install (if any) is already on PATH.
Summary
Issue: #3608871
The runtime browser tools in this module relied on Playwright being installed separately, with no self-contained way to ship/provision it with the module. This adds a js/ folder that:
- Owns a minimal
js/package.jsonwith a singleplaywrightruntime dependency, kept separate from the root webship-js BDD test suite. - Ships a runtime copy of the capture script (
js/browser-capture.mjs). - Excludes
node_modulesand downloaded browsers from git viajs/.gitignore(too large for a module repo).
src/PlaywrightRunner.php changes:
resolveScript()now prefersjs/<name>, falling back toscripts/<name>for back-compatibility.ensureRuntime()provisions Playwright + headless Chromium into a writable browsers directory (PLAYWRIGHT_BROWSERS_PATH) on first use, when the bundledjs/layout is present but not yet installed.capture()runs withPLAYWRIGHT_BROWSERS_PATHpointed at that provisioned directory.
Local smoke test: capture used the js/ script, provisioned the browsers, and returned the Home page successfully.
AI-Generated: Yes (Used Claude Code).
Checkpoints
- File an issue about this project
- Addition/Change/Update/Fix to this project
- Testing to ensure no regression
- Automated unit/functional testing coverage
- Developer Documentation support on feature change/addition
- User Guide Documentation support on feature change/addition
- UX/UI designer responsibilities
- Accessibility and Readability
- Reviewed by a human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Update Release Notes
- Release