Skip to content

Fix E2E test workflow setup#1173

Merged
mauteri merged 28 commits intodevelopfrom
fix-e2e-test-setup
Dec 6, 2025
Merged

Fix E2E test workflow setup#1173
mauteri merged 28 commits intodevelopfrom
fix-e2e-test-setup

Conversation

@mauteri
Copy link
Copy Markdown
Contributor

@mauteri mauteri commented Aug 15, 2025

Description of the Change

Fixes E2E test failures in GitHub Actions CI.

Changes

  • Add npm run build step to generate required assets
  • Switch to REST API authentication using @wordpress/e2e-test-utils-playwright
  • Use query parameter format for REST API verification (compatible with wp-env)
  • Simplify global setup following Gutenberg's approach

Why

The workflow was failing because:

  1. Missing /build directory caused requirements check to fail
  2. Pretty permalink REST URLs don't work in wp-env Docker environment

Tests now pass with proper plugin initialization.

Closes #

How to test the Change

Changelog Entry

Added - New feature
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability

Credits

Props @mauteri

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

mauteri and others added 28 commits August 15, 2025 11:01
The E2E tests were failing because the /build directory didn't exist,
causing requirements-check.php to fail and preventing the autoloader
from loading any classes.

Changes:
- Add 'npm run build' step before starting WordPress environment
- Simplify debugging output to essential verification steps
- Remove verbose debugging now that root cause is identified

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The plugin was working correctly all along - post types were registered.
The issue was that pretty permalinks (/wp-json/...) don't work in
wp-env Docker environment. Switched to query parameter format
(?rest_route=/wp/v2/types/...) which works reliably.

Changes:
- Remove permalink configuration (unnecessary)
- Use ?rest_route= format instead of /wp-json/ pretty URLs
- This matches how @wordpress/e2e-test-utils authenticates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 6, 2025

Preview changes with Playground

You can preview the recent changes for PR#1173 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri mauteri changed the title Fix e2e tests. Fix E2E test workflow setup Dec 6, 2025
@mauteri mauteri marked this pull request as ready for review December 6, 2025 19:09
@mauteri mauteri merged commit 4c3297d into develop Dec 6, 2025
19 checks passed
@mauteri mauteri deleted the fix-e2e-test-setup branch December 6, 2025 19:09
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