Repository navigation
E2E: Mock Openverse in image drag-and-drop inserter test - #83842
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
🤖 PR meta 🤖📦 Bundle sizeSize Change: 0 B Total Size: 8.24 MB
🏁 Flaky testsShow the failuresSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. should update the URL from the last navigation if only varies in the URL fragment in
|
andrewserong
left a comment
There was a problem hiding this comment.
Thank you, I was just about to put up something similar. LGTM!
Mamaduka
left a comment
There was a problem hiding this comment.
Makes sense and is better than skipping the test. IIRC, WP mocks similar requests a lot to make tests reliable.
|
I don't think there's any advantage to waiting for the tests to pass, so I've force merged it. |
…3842) Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
What?
Fixes the
Image › can be replaced by dragging-and-dropping images from the insertere2e test, which has been failing on trunk and every PR since 6fd2f58.Why?
The test depended on live Openverse. In CI, the browser fetch of the first result (a
live.staticflickr.comimage) now fails withnet::ERR_FAILED, so no upload happens and the image block stays empty. The same URL still loads outside CI, so the host is likely blocking or rate limiting GitHub runners.How?
The test mocks the Openverse API with
page.routeand serves two fixture PNGs fromtest/e2e/assetsunder a fakeopenverse.testhost. The drag, upload and replace flow under test is unchanged.Testing Instructions
npm run wp-env-test startnpm run test:e2e -- test/e2e/specs/editor/blocks/image.spec.js -g "dragging-and-dropping images from the inserter" --repeat-each=3api.openverse.org.Testing Instructions for Keyboard
N/A, test only.
Use of AI Tools
Claude Code diagnosed the CI failure and wrote the change; I reviewed it.