Repository navigation
test(e2e): Add global image transformations spec - #1343
Open
utkarshcloudinary wants to merge 1 commit into
Open
utkarshcloudinary wants to merge 1 commit into
utkarshcloudinary wants to merge 1 commit into
Conversation
Check that the global image format and quality settings reach the delivery URL of a newly synced image: - non-default values (webp, 60) give f_webp and q_60 - reverting to the defaults gives f_auto and q_auto - "Not set" removes the f_ and q_ parameters
gabrielcld2
reviewed
Oct 27, 2026
gabrielcld2
left a comment
Collaborator
There was a problem hiding this comment.
@utkarshcloudinary this is looking good! Just a few suggestions
| requestUtils, | ||
| } ) => { | ||
| // Set the non-default values first, so this test proves the | ||
| // revert and does not only read the defaults. |
Collaborator
There was a problem hiding this comment.
issue: The revert test doesn't prove a revert. It saves webp/60, immediately saves auto/auto, then uploads a new image. Nothing is rendered while webp is set, so the first save has no visible effect. The test passes even when the plugin ignores the settings entirely.
| * | ||
| * Each call gets a fresh attachment, so the image is synced with the | ||
| * settings that are active at that time. The timestamp in the filename | ||
| * gives a fresh public ID, so no CDN cache from an earlier run applies. |
Collaborator
There was a problem hiding this comment.
suggestion (non-blocking): The per-test upload and sync is probably unnecessary. The JSDoc says each test needs a fresh attachment "so the image is synced with those settings". But f_/q_ are applied when the page is rendered, not when the image is synced.
This branch has not been deployed
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.
Adds an e2e spec that checks the global image format and quality settings reach the delivery URL of a newly synced image.
Approach
tests/e2e/cloudinary-global-transformations.spec.js(@serial, real credentials needed forwp cloudinary sync). Each test uploads and syncs a fresh attachment after the settings are saved, so the image is synced with those settings.image_freeformis empty, so the server writes the final delivery URL intosrc. All changed settings are restored inafterAll.f_andq_params from the transformation segments of the URL, not from a plain substring match.webp,60): the URL hasf_webpandq_60.auto, andMedia::default_image_transformations()still writes it into the URL. So the revert test checks that the explicit values are replaced byf_auto/q_auto.Not set(none) is the only value that removes the params. A third test checks that the URL then has nof_orq_.QA notes
npm run test:e2e:serial -- cloudinary-global-transformations