test(e2e): verify Cloudinary video delivery (WP player + Cloudinary player)#1178
Open
utkarshcloudinary wants to merge 9 commits into
Open
test(e2e): verify Cloudinary video delivery (WP player + Cloudinary player)#1178utkarshcloudinary wants to merge 9 commits into
utkarshcloudinary wants to merge 9 commits into
Conversation
…p-env Both option patch update and insert fail when cloudinary_media_display does not yet exist as an array (fresh wp-env returns boolean false, and the wizard spec that would persist defaults runs later in CI). A merge-based update_option bootstraps the option and preserves existing keys in all states.
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.
Approach
Adds e2e coverage for video delivery on top of the image-delivery PR. The new spec exercises both video render paths the plugin supports:
video_player=wp) — verifies the plugin's server-sidestr_replacerewrites the<video>/<source>srcto ares.cloudinary.com/<cloud_name>/...URL.video_player=cld) — verifies the plugin emits aplayer.cloudinary.comiframe whose query string carries the configuredcloud_nameand a non-emptypublic_id.New files
tests/e2e/cloudinary-video-delivery.spec.js— the spec, structured as two nested describes (one per player) under a shared lifecycle.tests/e2e/fixtures/test-video.mp4— small (~2KB) silent fixture generated via ffmpeg.Shared lifecycle
beforeAllconnects the plugin via WP-CLI (reusesutils/connection.js).beforeEachuploads the fixture via the WP REST media endpoint, creates a published post containing a singlecore/videoblock, then runswp cloudinary syncso the asset is pushed to Cloudinary deterministically.afterEachdeletes both the post and the attachment via WP-CLI.Cloudinary-player scoping
The cld test toggles
cloudinary_media_display.video_playertocldin its ownbeforeAllviawp option patch updateand reverts towpinafterAll. Other specs (and the wp-player test) are unaffected.Decisions worth flagging
?force=trueappended to?rest_route=-style REST URLs fragile.wp option patch updateso we don't fetch-modify-write the whole 33-keycloudinary_media_displayblob.QA notes
Requires
CLOUDINARY_E2E_URLto be set (already wired via the e2e workflow secret and via.envlocally).Expected: 2 passed (~30s). Full suite (
npm run test:e2e) should report 10 passed.To inspect a run:
After running, confirm the setting was reverted:
Expected:
wp.