test: Automate manual test cases with wp-env E2E tests#329
Draft
dcalhoun wants to merge 11 commits intofeat/local-wordpress-wp-envfrom
Draft
test: Automate manual test cases with wp-env E2E tests#329dcalhoun wants to merge 11 commits intofeat/local-wordpress-wp-envfrom
dcalhoun wants to merge 11 commits intofeat/local-wordpress-wp-envfrom
Conversation
GutenbergKit delegates save/publish to the native host app, so this test case does not belong in the editor's E2E suite.
Introduce `e2e/wp-env-fixtures.js` which reads wp-env credentials from `.wp-env.credentials.json` and fetches editor settings from the WP REST API. Update `EditorPage.setup()` to inject wp-env config (siteApiRoot, authHeader, editorSettings) by default so all E2E tests run against a real WordPress backend. Add helper methods to EditorPage: `getBlockAttribute()`, `setTextAlignment()`, `openBlockSettings()`, and `waitForMediaUpload()`. Update `editor-error.spec.js` to use an unreachable API root so the plugin load failure test still works with wp-env credentials present.
Add minimal test files used by the media upload E2E tests: - test-image.png (1x1 RGBA PNG) - test-image-2.png (1x1 RGBA PNG, second image for gallery) - test-video.mp4 (minimal MP4 container) - test-audio.mp3 (minimal MP3 frame) - test-file.pdf (minimal PDF document)
Add Playwright E2E tests that verify media upload flows against wp-env: - S.2 image-upload: Upload image via Image block, verify block attributes - S.3 video-upload: Upload video via Video block, verify src attribute - F.4 gallery-block: Upload multiple images, verify inner blocks and caption editing - F.6 audio-upload: Upload audio via Audio block, verify src attribute - F.7 file-upload: Upload file via File block, verify href and fileName All tests use the filechooser event to simulate file selection and `waitForMediaUpload()` to wait for the upload to complete.
Add Playwright E2E tests for non-upload editor features against wp-env: - F.1 text-alignment: Verify center/right alignment on paragraph and verse blocks via the toolbar dropdown - F.2 embed-content: Insert YouTube embed URL and verify oEmbed resolution; test fallback for non-embeddable URLs - F.3 color-gradient: Apply background color via Block Settings UI, verify theme gradients are available, apply gradient via data store - F.5 pattern-insertion: Fetch patterns from WP REST API, insert parsed pattern content via wp.blocks.parse() + insertBlocks()
Automated tests live in the E2E suite and don't need to be duplicated in the manual test cases document. Only S.1 (Undo/Redo) remains since it requires the native toolbar.
Move the E2E step from the `mac` queue to `default` (Linux EC2 with Docker) so wp-env can start and provide the credentials file needed by all E2E tests. Also install Playwright with `--with-deps` on CI to pull in required system libraries on Linux.
…right is related to trying to run it within a virtualized environment (AMI/VM) or if it's unrelated
…th Playwright is related to trying to run it within a virtualized environment (AMI/VM) or if it's unrelated" This reverts commit 7b5aafe.
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.
What?
Automates all remaining manual test cases from
docs/test-cases.mdas Playwright E2E tests running against wp-env, and migrates the existing E2E suite to use wp-env for a more realistic testing environment.Why?
The manual test cases (media uploads, text alignment, embeds, color/gradient, gallery, patterns) all require a real WordPress backend. With wp-env now available, these can be automated to run in CI and reduce the manual testing burden.
How?
e2e/wp-env-fixtures.js): Reads credentials from.wp-env.credentials.jsonand fetches/caches editor settings from the WP REST API.e2e/editor-page.js):setup()now injects wp-env config (siteApiRoot, authHeader, editorSettings) by default. Added helper methods:getBlockAttribute(),setTextAlignment(),openBlockSettings(),waitForMediaUpload().docs/test-cases.md. Only S.1 (Undo/Redo) remains as a manual test.Testing Instructions
make wp-env-startmake test-e2eAccessibility Testing Instructions
N/A — no UI changes.
Screenshots or screencast
N/A — test infrastructure only.