The wix-preview-tester uses a method called refreshTestsConfigs
to preview local source code with the Wix CLI and save siteRevision
and branchId
in a file named wix-preview-tester.config.json
.
For example, by executing refreshTestsConfigs
in the pre-commit
of .git/hooks
, you can keep siteRevision
and branchId
under source code management.
Furthermore, by using getTestsConfig
, you can read this file to use Wix Preview URLs as a snapshot at the time of commit, and execute E2E tests on CI.
- Git Integration & Wix CLI
- wix login - Log in to your Wix account
Add to package.json
{
"devDependencies": {
"wix-preview-tester": "git+https://github.com/hand-dot/wix-preview-tester.git"
}
}
node
const { setTestsConfig, getTestsConfig, refreshTestsConfigs } = require('wix-preview-tester');
CLI - run refreshTestsConfigs (require install local and npm link)
npx wix-preview-tester