Repository navigation
Repair wp/6.3 branch Actions: Fix flaky Openverse image drag-and-drop e2e test - #551
Closed
desrosj wants to merge 1 commit into
Conversation
desrosj
added this pull request to stack #552
September 28, 2026 15:25
desrosj
removed this pull request from stack #552
September 28, 2026 18:41
desrosj
changed the base branch from
fix-actions-6.3/fix-activate-theme-navigation-race
to
wp/6.3
September 28, 2026 18:43
desrosj
force-pushed
the
fix-actions-6.3/fix-flaky-openverse-image-drag-and-drop-test
branch
from
September 28, 2026 18:45
b3bfb2c to
46bcdea
Compare
desrosj
changed the base branch from
wp/6.3
to
fix-actions-6.3/fix-activate-theme-navigation-race
September 28, 2026 18:46
desrosj
added this pull request to stack #563
September 28, 2026 18:46
`test/e2e/specs/editor/blocks/image.spec.js`'s "can be replaced by dragging-and-dropping images from the inserter" test opens the inserter's Openverse media tab and drags real search results onto an image block. `packages/editor/src/components/media-categories/index.js`'s Openverse `fetch()` calls the real, external `https://api.openverse.engineering/v1/images/` API directly from the browser, and `packages/block-editor/src/components/inserter/media-tab/media-preview.js`'s `onMediaInsert()` makes a second real `window.fetch()` against the dragged item's own URL to download the full-size image for upload to the media library on drop. Depending on two live third-party network calls makes `dragTo()` unreliable in CI, and ties test success to an external service's uptime. Mock both requests with `page.route()`, following this file's own existing `page.route()` precedent (`test/e2e/specs/editor/plugins/nonce.spec.js`): the search request is fulfilled with two fake Openverse-shaped results, and the two fake image URLs those results reference are fulfilled with the local `10x10_e2e_test_image_z9T8jK.png` fixture already used elsewhere in this same file. Both mocked routes include an `Access-Control-Allow-Origin: *` header, since this test's code makes real cross-origin `fetch()` calls against both endpoints, which the browser would otherwise block. The test no longer touches any live external host.
desrosj
removed this pull request from stack #563
September 28, 2026 19:03
desrosj
changed the base branch from
fix-actions-6.3/fix-activate-theme-navigation-race
to
wp/6.3
September 28, 2026 19:03
desrosj
force-pushed
the
fix-actions-6.3/fix-flaky-openverse-image-drag-and-drop-test
branch
from
September 28, 2026 19:03
46bcdea to
13d4970
Compare
desrosj
changed the base branch from
wp/6.3
to
fix-actions-6.3/fix-activate-theme-navigation-race
September 28, 2026 19:04
desrosj
added this pull request to stack #566
September 28, 2026 19:04
desrosj
marked this pull request as ready for review
September 28, 2026 19:18
Owner
Author
|
Moved to WordPress#83714. The branch is left in place. |
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?
Mocks the Openverse API in
test/e2e/specs/editor/blocks/image.spec.js's "can be replaced by dragging-and-dropping images from the inserter" test, usingpage.route(): both the search request toapi.openverse.engineeringand the image files its results point to are served locally, from a fixture image already intest/e2e/assets.Why?
The test drags an image from the inserter's Openverse media category, which fetched its results from the real, external Openverse API. That made the test depend on a third-party service's availability and response time, and it failed intermittently with
TimeoutError: locator.dragTo: Timeout 10000ms exceededwhen the results were slow or missing. Mocking the request the same waytest/e2e/specs/editor/plugins/block-directory.spec.jsalready mocks the block directory API removes the network dependency.This replaces #352 with the same change on a branch named for the specific problem it fixes.
Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code