Skip to content

fix: reorder base url configuration logic - #89

Open
laura-johnson wants to merge 1 commit into
3.xfrom
fix-base-url-resolution
Open

fix: reorder base url configuration logic#89
laura-johnson wants to merge 1 commit into
3.xfrom
fix-base-url-resolution

Conversation

@laura-johnson

Copy link
Copy Markdown
Contributor

Description

Note: This bug only affects local testing, not in the CI.

When running VRT on local, the test always passes because of the ordering logic. This fxes baseURL resolution in the Playwright config so VRT actually compares two environments.

@fkbender/playwright-vrt-scripts runs the suite twice, setting REMOTE_ENV_BASE_URLper pass — baseline first to write snapshots, then the candidate to compare. The config resolvesCANDIDATE_URLahead of it, so any.envdefiningCANDIDATE_URL` pinned both passes to the candidate: the suite screenshotted the same site twice, compared it against itself, and passed no matter what changed.

CI is unaffected, because .env is gitignored and CANDIDATE_URL is unset there.

Testing steps

  • With both variables set, the baseline wins: REMOTE_ENV_BASE_URL=https://a.example CANDIDATE_URL=https://b.example node -e "console.log(require('./playwright.config').use.baseURL)" prints https://a.example/
  • With only CANDIDATE_URL set, it is still used as the fallback
  • From tests/playwright, run npm run vrt and confirm the log shows two passes against different URLs (baseline then candidate)
  • Make a visible CSS change locally, re-run npm run vrt, and confirm it now reports a diff — on the previous config this passed
  • Confirm the VRT CircleCI job still produces a playwright-vrt-report artifact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant