Skip to content

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

Closed
mattheu wants to merge 3 commits into
mainfrom
feature/playwright-playground-migration
Closed

Migrate E2E tests from @wordpress/env to WordPress Playground#19
mattheu wants to merge 3 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 3 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>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

Playwright test results

failed  10 failed
passed  8 passed

Details

stats  18 tests across 6 suites
duration  12 minutes, 27 seconds
commit  f354f50

Failed tests

chromium › elasticpress-toggle.spec.js › ElasticPress Toggle › should show the Use ElasticSearch toggle in the panel
chromium › elasticpress-toggle.spec.js › ElasticPress Toggle › should toggle the Use ElasticSearch setting on and off
chromium › exclude-with-post-in.spec.js › Exclude Displayed Posts with post__in › should exclude displayed posts even when post__in is set via Advanced Query Loop
chromium › exclude-with-post-in.spec.js › Exclude Displayed Posts with post__in › should properly filter post__in array when multiple post templates used
chromium › posts-per-page.spec.js › Posts Per Page Override › should show posts per page control when query inherits
chromium › posts-per-page.spec.js › Posts Per Page Override › should reflect posts per page override in editor
chromium › posts-per-page.spec.js › Posts Per Page Override › should enforce max value from posts_per_page setting
chromium › query-presets.spec.js › Query Presets › should show query preset dropdown when presets are registered
chromium › query-presets.spec.js › Query Presets › should change post order when selecting alphabetical preset in editor
chromium › query-presets.spec.js › Query Presets › should change post order when selecting Z-A preset in editor

@mattheu mattheu closed this Jul 6, 2026
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