Problem/Motivation
The runtime browser tools in this module rely on Playwright being installed separately (a global/system install, or a manual step outside the module). There is currently no self-contained way to ship and provision Playwright with the module itself, which makes the runtime browser capture tools harder to use out of the box.
Proposed resolution
Add a js/ folder that owns a minimal package.json with a single playwright runtime dependency, kept separate from the root webship-js BDD test suite. The module's PlaywrightRunner now:
- Prefers resolving the capture script from
js/<name>, falling back toscripts/<name>for back-compatibility. - On first use, provisions Playwright and headless Chromium into a writable browsers directory (
PLAYWRIGHT_BROWSERS_PATH) when the bundledjs/layout is present but not yet installed, so the tools work without a separate manual install step. - Runs
capture()withPLAYWRIGHT_BROWSERS_PATHpointed at that provisioned directory.
The node_modules package contents and downloaded browsers are not committed to the repository (a js/.gitignore excludes them - too large for a module repo). Provisioning is best-effort and degrades gracefully if it cannot complete in a given environment.
This is marked EXPERIMENTAL: a test MR that may or may not work in every environment.
Remaining tasks
- ✅ 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
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- N/A
Issue fork ai_playwright-3608871
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments