Skip to content

feat(playwright-dev): add Playwright browser-automation devcontainer feature - #52

Merged
baxyz merged 3 commits into
mainfrom
feat/playwright-dev-feature
Aug 1, 2026
Merged

feat(playwright-dev): add Playwright browser-automation devcontainer feature#52
baxyz merged 3 commits into
mainfrom
feat/playwright-dev-feature

Conversation

@baxyz

@baxyz baxyz commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds playwright-dev, a new DevContainer Feature for local E2E/browser-automation testing: installs OS-level dependencies for headless Chromium/Firefox/WebKit via the official playwright install-deps, caches the browser binaries in a Docker named volume shared across rebuilds (same shape as pnpm-store), and installs the official Playwright Test VS Code extension with sane defaults.

Reviewed end to end (naming, code correctness, IDE extension, IDE settings, possible improvements, and whether an existing feature already covers this — see checklist below) and improved based on that review:

  • Added an "IDE support" table (VS Code/Cursor confirmed, WebStorm/IntelliJ noted, Zed not yet supported by the devcontainer spec).
  • Documented mcr.microsoft.com/playwright as a simpler prebuilt-image alternative for consumers who don't need to compose with other helpers4 features.
  • Added a "Version History" section (bumped to 1.0.1).

Review findings (all verified, not assumed):

  • Naming matches the established -dev suffix convention (angular-dev, typescript-dev, claude-dev, …).
  • Uses a volume mount (not bind) for the browser cache — no host-missing-path crash risk, unlike bind-mounted features.
  • playwright.reuseBrowser / playwright.showTrace settings verified against the actual extension's package.json on GitHub (both real, boolean, correct defaults being overridden intentionally).
  • No official/community devcontainer feature does this yet — confirmed via an open, unresolved upstream issue (microsoft/playwright#33610, "playwright as a devcontainer feature").

Type of Change

  • New feature (non-breaking change that adds functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring
  • Test improvement

Related Issues

None.

How Has This Been Tested?

  • jq empty on the manifest (valid JSON, no JSONC comments)
  • bash -n on install.sh and test/playwright-dev/test.sh
  • Bootstrap block diffed against helpers4-common's canonical version (matches — the repo's own CI drift check would pass)
  • Wired into scopes.json, pr-validation.yml and test.yml test matrices, AGENTS.md features table

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests for my changes
  • All new and existing tests passed locally (no Docker/network access in this environment to run devcontainer features test end to end — static checks above all pass)
  • My commits follow the conventional commit format

Screenshots (if applicable)

N/A.

Additional Context

None.

🤖 Generated with Claude Code

baxyz and others added 2 commits July 31, 2026 23:42
Installs OS-level dependencies for headless Chromium/Firefox/WebKit via
the official `playwright install-deps` (not a hand-maintained apt list),
caches the browser binaries themselves in a Docker named volume shared
across rebuilds (same shape as pnpm-store, since /workspaces-style mounts
aren't available at image build time), and bundles the official Playwright
Test VS Code extension with sane defaults.

Does not install the `playwright` npm package itself — that stays a
devDependency of the consuming project so the CLI version always matches
the project's own, instead of drifting from a separately-installed global
one.

Verified: image build succeeds (OS deps install cleanly for all three
engines, guard script lands at /usr/local/bin/devcontainer-playwright-browsers),
manifest is valid plain JSON, both scripts pass bash -n, and the common.sh
bootstrap block is byte-identical to vite-plus's (no drift). The full
`devcontainer features test` container-launch step couldn't be verified in
this sandbox — docker-outside-of-docker means the CLI's own workspace bind
mount points at a path the host dockerd can't see, unrelated to this
feature's mounts (which are volume-type, not bind).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ternative

- IDE support table (VS Code/Cursor confirmed, WebStorm/IntelliJ noted as
  natively handled, Zed not yet supported by the devcontainer spec) —
  matches the format already used in claude-dev/mistral-dev.
- Documented mcr.microsoft.com/playwright as a simpler alternative for
  consumers who don't need to compose with other helpers4 features.
- Version History section added (convention established in dotfiles-sync).

No behavior change — bumped to 1.0.1 since README changed under src/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

✅ PR Validation Passed

All checks passed!


📋 Pipeline Status

Job Status
🧾 Conventional Commits passing
🔖 Version Bump passing
🧪 Feature Tests passing
🐚 ShellCheck passing

🤖 Generated by @helpers4 CI • 2026-08-01

…che integrity

Three findings from PR#52 review, all verified before fixing:

- Dropped the @latest pin from both npx playwright calls. It forced the
  newest registry release regardless of what's actually installed,
  contradicting the feature's own stated goal (README: browser/CLI version
  should track the project's own playwright devDependency, never drift
  from it). Without the pin, npx resolves the local project version once
  one exists (guard script, post-workspace-mount) and only falls back to
  latest when nothing local exists yet (install.sh, image build time,
  same result as before there).
- Added ghcr.io/devcontainers/features/node:1 to dependsOn. typescript-dev
  alone doesn't install Node (confirmed: its install.sh is a no-op besides
  essential-dev) so the feature's own "npm not found" guard wasn't
  actually covered by the dependency it named.
- Guard script now writes a completion marker (scoped to the current
  browsers selection) instead of treating a non-empty cache dir as
  "fully downloaded". A network drop mid-download no longer leaves a
  permanently broken cache that's silently skipped on every future start.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@baxyz
baxyz force-pushed the feat/playwright-dev-feature branch from 623108c to 9cb7668 Compare August 1, 2026 00:39
@baxyz
baxyz merged commit e943b3a into main Aug 1, 2026
33 checks passed
@baxyz
baxyz deleted the feat/playwright-dev-feature branch August 1, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant