Repository navigation
test(e2e): Add per-asset overlay and crop spec - #1316
Open
utkarshcloudinary wants to merge 2 commits into
Open
utkarshcloudinary wants to merge 2 commits into
utkarshcloudinary wants to merge 2 commits into
Conversation
Drive the real Edit Asset UI to save a text overlay and a crop, then assert the front-end image delivery URL picks them up and reverts to the default once they are removed.
When the theme emits a srcset, the lazy-loader restores it and keeps the SVG placeholder in src, so the src check failed in CI. Assert on currentSrc, which is the URL the browser loads in both cases.
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 a Playwright spec that edits one asset through the real Edit Asset UI. It checks that a text overlay and a crop change the front-end image URL, and that removing them reverts the URL to the default.
Approach
tests/e2e/cloudinary-asset-edit.spec.js(@serial, needsCLOUDINARY_E2E_URL):beforeAlluploads one image, publishes a post with an inline image block, and runswp cloudinary sync. The two tests share this asset, so the file runs in serial mode.admin.php?page=cloudinary§ion=edit-asset&asset=<ID>, types the overlay text, and clicks Save Changes. On the front end,srcanddata-transformationscontainl_text:Arial_20:<text>andfl_layer_apply. The test then clicks Reset All and saves again.srcanddata-transformationsare then the same as before the edit.c_crop,h_120,w_160in Asset transformations and saves. The crop is then insrcanddata-transformations. The test then clears the field and saves. The values are then the same as before the edit.save_assetresponse and checks that it has nonote, which the plugin returns for a transformation that is not valid.res.cloudinary.com/<cloud_name>/URL intosrc. It does not use fixed timeouts.QA notes
cp .env.example .envand setCLOUDINARY_E2E_URLto a test account.npm run env:start, ornpx wp-env start --config .wp-env.ci.jsonfor the plain HTTP setup that CI uses.npm run test:e2e:serial -- cloudinary-asset-edit, or with the CI config:WP_BASE_URL=http://localhost:8889 ./.wp-env/scripts/run-e2e.sh cloudinary-asset-edit --workers=1.