fix: reorder base url configuration logic - #89
Open
laura-johnson wants to merge 1 commit into
Open
Conversation
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.
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
baseURLresolution in the Playwright config so VRT actually compares two environments.@fkbender/playwright-vrt-scriptsruns 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
.envis gitignored andCANDIDATE_URLis unset there.Testing steps
REMOTE_ENV_BASE_URL=https://a.example CANDIDATE_URL=https://b.example node -e "console.log(require('./playwright.config').use.baseURL)"printshttps://a.example/CANDIDATE_URLset, it is still used as the fallbacktests/playwright, runnpm run vrtand confirm the log shows two passes against different URLs (baseline then candidate)npm run vrt, and confirm it now reports a diff — on the previous config this passedplaywright-vrt-reportartifact