Fill in E2E tests for client-side media processing#75949
Fill in E2E tests for client-side media processing#75949adamsilverstein wants to merge 11 commits intotrunkfrom
Conversation
|
Size Change: 0 B Total Size: 6.84 MB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 8.75 MB ℹ️ View Unchanged
|
Adds image files covering format, transparency, EXIF rotation, animation, and oversized dimensions for use in client-side media processing E2E tests. Includes a Node.js generation script for reproducibility.
Plugins for E2E tests: PNG-to-JPEG conversion, JPEG-to-WebP conversion, and progressive/interlaced image saving via WordPress filters.
Covers upload, compression, sub-size generation, batch uploads, server fallback, error handling, browser capabilities, MIME format conversion, EXIF rotation, oversized scaling, and transparency preservation.
Measures single image, large image with processing, and multiple simultaneous upload timings. Adds new metrics to the performance reporter.
- Remove unused `page` destructuring from test functions that access page via fixture - Fix prettier formatting for single-line locator and path.join calls - Add JSDoc type annotations to pushBits/bitsToBytes functions and bits variable - Add eslint-enable directive for playwright/expect-expect in media-upload perf test - Remove unused eslint-disable-next-line for playwright/no-skipped-test in fixture method Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add eslint-disable no-bitwise for binary file generator script - Remove unused channels variable in createPNG - Fix prettier formatting in generate-test-media-assets.mjs - Fix JSDoc alignment, getSelectedBlockImageId formatting, and locator string formatting in client-side-media-processing E2E spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Increase compression size tolerance from 3x to 5x for varying server configs - Accept both original and converted MIME types for format conversion tests - Accept both rotated and non-rotated dimensions for EXIF orientation test - Fix error handling test to check both snackbar and notice components Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a3211e0 to
bdcae66
Compare
The test was waiting for a snackbar/error notice that never appears due to a double-unwrapping bug in the error callback chain between the editor and upload-media packages. Instead, assert that the upload queue drains and the image block remains in placeholder state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test cannot reliably intercept uploads made from within the editor iframe's fetch context during client-side media processing. Additionally, the error callback chain has a double-unwrapping bug that prevents errors from surfacing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
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. |
The 3200x2400 responsive lightbox JPEG was committed as a test asset but was not included in the generator script.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Flaky tests detected in 1d82581. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23217992356
|
andrewserong
left a comment
There was a problem hiding this comment.
Just looking over the additional tests, and I'm wondering if they're a bit verbose / if we're doing too much granular testing for e2es. I.e. if much of the conversion is already covered by unit tests, do we need all the different e2e test configurations? And if some of the tests are skipped if not cross origin isolated, how useful are they to be included at this stage?
There seems to be a bit of duplication, and lots of separate page loads, so I wondered if they can be simplified. In general, e2e tests tend to take a long time to run, so that's the main reason I wondered about it 🙂
Another thing is I'm wondering if the included .webp file is valid? It doesn't appear to load for me:
I do think it's a good idea to add e2es, though!
| * Plugin URI: https://github.com/WordPress/gutenberg | ||
| * Author: Gutenberg Team | ||
| * | ||
| * @package gutenberg-test-image-interlaced-progressive |
There was a problem hiding this comment.
Is this plugin used? If not can it be removed?
| /** | ||
| * Generate test media assets for client-side media processing E2E tests. | ||
| * | ||
| * Uses raw binary construction to create valid image files without external dependencies. | ||
| * Run: node bin/generate-test-media-assets.mjs | ||
| */ |
There was a problem hiding this comment.
This file is clever, and in principle I like the idea of making it easy to generate or regenerate images as needed. But it seems tangential to the task of adding test image assets to the repo for e2e tests. Is it necessary to include it? How frequently do we imagine needing to add new assets?
Summary
Closes #74367.
Test plan
client-side-media-processing.spec.jsbig-image-size-threshold.spec.jstests still passmedia-upload.spec.js