Skip to content

Migrate E2E tests from @wordpress/env to WordPress Playground#19

Open
mattheu wants to merge 2 commits into
mainfrom
feature/playwright-playground-migration
Open

Migrate E2E tests from @wordpress/env to WordPress Playground#19
mattheu wants to merge 2 commits into
mainfrom
feature/playwright-playground-migration

Conversation

@mattheu

@mattheu mattheu commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Replaces Docker-based @wordpress/env with WordPress Playground (@wp-playground/cli), fixing the CI hangs and apt-lock issues from previous PRs
  • Playground boots and tears down automatically within the test run — no separate start/stop steps in CI
  • Adds a PHP × WP version matrix (PHP 8.3/8.4 × WP 6.8/6.9/latest) for better compatibility coverage

Changes

File Change
blueprint.json New — defines Playground env: WP 6.9, PHP 8.3, TwentyTwentyFive, Advanced Query Loop, mu-plugins, 25 seeded test posts
global-setup.js New (project root) — boots Playground, saves auth state
global-teardown.js New (project root) — shuts down Playground after tests
playwright.config.js Dynamic WP_BASE_URL, 120s timeout, points to new setup/teardown
.github/workflows/playwright-tests.yml Removes Docker/wp-env steps, adds PHP/WP matrix
tests/e2e/fixtures.js Removes wpCli/resetDatabase (wp-env specific)
tests/e2e/global-setup.js Deleted — replaced by project-root version
package.json Adds @wp-playground/cli, removes @wordpress/env, updates scripts
CLAUDE.md Updates testing docs to reflect Playground setup

Test plan

  • Run npm run build && npm run test:e2e locally to verify Playground boots and all tests pass
  • Confirm CI passes across the full PHP/WP matrix on this PR

🤖 Generated with Claude Code

mattheu and others added 2 commits June 9, 2026 11:34
Replaces the Docker-based test environment with WordPress Playground via
@wp-playground/cli, eliminating the CI hangs and apt-lock issues caused
by Docker setup. Playground boots automatically when tests run and tears
down after, with no separate start/stop steps needed.

Key changes:
- Add blueprint.json: defines Playground environment (WP 6.9, PHP 8.3,
  TwentyTwentyFive, Advanced Query Loop plugin, mu-plugins, 25 test posts)
- Add global-setup.js / global-teardown.js at project root (Playground lifecycle)
- Update playwright.config.js: dynamic WP_BASE_URL, 120s timeout, no Docker
- Update CI workflow: remove Docker steps, add PHP/WP version matrix
  (PHP 8.3/8.4 × WP 6.8/6.9/latest)
- Remove tests/e2e/global-setup.js and wpCli/resetDatabase from fixtures.js
- Remove @wordpress/env dependency, add @wp-playground/cli

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants