Add Playwright e2e test for Cloudinary setup wizard#1171
Draft
PatelUtkarsh wants to merge 3 commits intocloudinary:developfrom
Draft
Add Playwright e2e test for Cloudinary setup wizard#1171PatelUtkarsh wants to merge 3 commits intocloudinary:developfrom
PatelUtkarsh wants to merge 3 commits intocloudinary:developfrom
Conversation
9e653a5 to
18a4474
Compare
Covers the three behaviours users care about: invalid credentials are rejected and Next stays disabled; valid credentials walk the wizard through all four tabs to completion; and a completed wizard does not reappear on subsequent visits to the plugin page. Connection credentials are read from CLOUDINARY_E2E_URL (deliberately distinct from the SDK's CLOUDINARY_URL convention) which can be provided via shell export or a gitignored .env file. The test cannot use a PHP-side connection constant because the plugin then hides the wizard's connection input.
The wizard setup spec needs a real Cloudinary connection string at runtime. Plumb it through from the repository secret of the same name.
18a4474 to
22df49b
Compare
gabrielcld2
approved these changes
May 7, 2026
Collaborator
gabrielcld2
left a comment
There was a problem hiding this comment.
A small suggestion but otherwise it all looks good so far.
| wizardWrap: '.cld-wizard', | ||
| }; | ||
|
|
||
| test.describe( 'Cloudinary wizard setup (WPP-1201)', () => { |
Collaborator
There was a problem hiding this comment.
nitpick: This is the internal ticket number. Perhaps it's better not having these within the public repo as it's internal context only.
Contributor
Author
There was a problem hiding this comment.
Done in 450afc6.
We can squash merge and update commit message or I can update commit message to remove internal ticket and force push.
Remove WPP-1201 ticket reference from test.describe() to avoid exposing internal project context in public repository.
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.
Summary
tests/e2e/wizard-setup.spec.js) with three tests covering the setup wizard: invalid credentials are rejected and Next stays disabled; valid credentials walk all four tabs to completion; a completed wizard does not reappear on subsequent visits.tests/e2e/utils/wizard.js) that resets the Cloudinary connection between tests via directdocker execagainst the*-tests-cli-1container (working around the knownnpx wp-env run cliIPv6 timeout on macOS).CLOUDINARY_E2E_URLthrough the existinge2eGitHub Actions job.Why a dedicated env var
The variable is intentionally named
CLOUDINARY_E2E_URL, notCLOUDINARY_URL, so it cannot collide with the Cloudinary SDK convention or with anything a developer might define in.wp-env.override.jsonfor local dev. DefiningCLOUDINARY_URL(orCLOUDINARY_CONNECTION_STRING) as a PHP constant makes the plugin treat the connection as already-configured and hides the wizard's connection input — which makes this spec impossible to run. The README documents this explicitly.Local credential delivery
Two paths, in order of precedence:
export CLOUDINARY_E2E_URL='cloudinary://...'.envfile (gitignored)..env.exampleis included as a template; Playwright loads it viadotenvat startup.CI
The
e2ejob in.github/workflows/ci.ymlnow passesCLOUDINARY_E2E_URLfrom a repository secret of the same name.Test Plan
Locally verified:
npm run test:e2e) — 7/7 green (hello-world2 +plugin2 +wizard-setup3)npm run lint:js -- tests/e2e/— clean.env-only path works (no shell var).envReviewer verification:
CLOUDINARY_E2E_URLrepository secret is sete2ejob passes on this PR