Repository navigation
test(e2e): Cover delivery through a custom domain (CNAME) - #1353
Open
utkarshcloudinary wants to merge 4 commits into
Open
utkarshcloudinary wants to merge 4 commits into
utkarshcloudinary wants to merge 4 commits into
Conversation
utkarshcloudinary
marked this pull request as draft
November 2, 2026 12:17
utkarshcloudinary
changed the base branch from
develop
to
test/responsive-breakpoints-lazy-load-e2e
November 2, 2026 12:23
utkarshcloudinary
marked this pull request as ready for review
November 2, 2026 12:24
Move galleryBlock(), openGallery() and collectImageUrls() out of the gallery delivery spec into tests/e2e/utils/gallery.js, so the custom domain spec can render the Gallery block the same way.
- ensureCloudinaryConnected() accepts { cname, privateCdn } and adds
them to the connection string. It now fails when the plugin does
not save the new string.
- expectCloudinaryUrl() accepts { host, cloudName, privateCdn }.
- routeCnameToCloudinary() sends requests for a fake custom domain on
to res.cloudinary.com, so the images still load.
Connect with a fake custom domain and check that the image block, the Gallery widget and the Cloudinary video player use it. Check that private_cdn=false keeps the cloud name in the path. Restore the plain connection in afterAll. Refs WPP-1240
Replace the local saveSettings() copy with the one in tests/e2e/utils/settings.js.
utkarshcloudinary
force-pushed
the
test/WPP-1240-cname-delivery-e2e
branch
from
November 2, 2026 14:18
2dd4986 to
ef58d3a
Compare
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 for delivery through a custom domain (CNAME). The spec connects with a fake domain in the connection string and checks that the image block, the Gallery widget and the Cloudinary video player use it. It also checks that
private_cdn=falsekeeps the cloud name in the path.Stacked on #1342. This PR targets the #1342 branch, because the spec checks
srcsetURLs and needs itsparseSrcset()fix. Both PRs are in GitHub stack #1354, so merge #1342 first.Approach
cloudinary-cname-delivery.spec.js(@serial) connects with?cname=cdn.e2e-cloudinary.testbefore the upload, as the ticket suggests. The plugin only checks the domain format and never resolves it.routeCnameToCloudinary()sends requests for the fake domain on tores.cloudinary.com, and adds the cloud name to the path for a private CDN. So the images really load, and the Gallery widget reachesdata-ready="true". This also proves that the path the plugin builds is a valid Cloudinary path.srcand everysrcsetURL use the domain, and the path does not start with/<cloud_name>/. Lazy load is off and breakpoints are on, so the server writes a Cloudinarysrcsetto check.<img>URL uses the domain.cloudinary[cname],cloudinary[secure_distribution]andcloudinary[private_cdn].private_cdn=false: the URLs use the domain, and the path starts with/<cloud_name>/.afterAllconnects without the domain first, then restores the settings and deletes the posts and attachments. So the other delivery specs in the same serial run get plainres.cloudinary.comURLs.ensureCloudinaryConnected()accepts{ cname, privateCdn }. It now fails if the plugin does not save the new connection string, which the plugin does when the API test of the string fails.expectCloudinaryUrl()accepts{ host, cloudName, privateCdn }. A plain cloud name still works as before.tests/e2e/utils/gallery.js. The gallery spec uses them and works as before.QA notes
npm run test:e2e:serial -- cloudinary-cname-deliverynpm run test:e2e:serial(the other delivery specs must still pass after this spec in the same run)