fix(e2e): make the suite target the actual wp-env instance - #1358
Merged
Conversation
Three unrelated local-env breakages, all of which made the suite fail without any product regression: - The port was hardcoded to 8889 by the @wordpress/scripts defaults, so a checkout that pins another port in .wp-env.override.json (8889 is often taken by a second checkout) ran every spec against an unrelated site. Resolve WP_ENV_TESTS_PORT -> .wp-env.override.json -> 8889; CI is unchanged as it has neither. - The two e2e mu-plugins were mapped as individual files. Docker Desktop single-file bind mounts go stale when an editor saves atomically, so the container saw 0-byte helpers and the lazy-render / database-source specs silently ran without them. Map the directory instead. - lazy-render waited for the `data-visualizer-script` placeholders, but the loader legitimately swaps them on the first user interaction, and Chromium fires a real `mouseover` right after navigation. Assert lazy mode via the persistent container class instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
💂♂️ PR Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Contributor
Contributor
|
🎉 This PR is included in version 4.0.7 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The e2e suite failed 38/49 locally with no product regression behind it. Three independent environment breakages:
@wordpress/scripts' Playwright config hardcodeshttp://localhost:8889. A checkout that pins another port in.wp-env.override.json(8889 is routinely taken by a second checkout) ran every spec against an unrelated WordPress site — all 38 failures wererest_no_route. The config now resolvesWP_ENV_TESTS_PORT→.wp-env.override.json→8889, and pointswebServer.portat the same value.lazy-render/database-sourcespecs silently ran without their helpers. Mapping the directory (wp-content/mu-plugins→tests/e2e/config/mu-plugins, the Gutenberg pattern) fixes it; the files moved accordingly.lazy-render. It waited for thedata-visualizer-scriptplaceholders to be attached, but the loader legitimately swaps them on the first user interaction — and Chromium fires a realmouseoverright after navigation whenever the cursor sits over the page. At failure the chart was already fully rendered. It now asserts lazy mode via the persistent.visualizer-lazy-rendercontainer class, which is not transient.Also gitignores
.wp-env.override.json, which was untracked but not ignored — onegit add .away from being committed.CI is unaffected by the port change: with no override file and no env var, it resolves to 8889 exactly as before.
Will affect visual aspect of the product
NO — test/infra only, no plugin code touched.
Test instructions
npx wp-env start && npm run test:e2e:playwright→ 49 passed, 0 failed.npm run gutenberg:build && npm run d3renderer:buildfirst if you've never built locally (CI already does this).npx wp-scripts test-playwright --config tests/e2e/playwright.config.js --grep "Lazy rendered charts" --repeat-each=3→ 6/6.{"testsPort": 8890}in.wp-env.override.jsonand re-run; before this PR every spec fails withrest_no_route.Check before Pull Request is ready:
🤖 Generated with Claude Code