wix-incubator / wix-preview-tester

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wix-preview-tester

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.

Requirements

Install

Add to package.json

{
  "devDependencies": {
    "wix-preview-tester": "git+https://github.com/hand-dot/wix-preview-tester.git"
  }
}

Usage

node

const { setTestsConfig, getTestsConfig, refreshTestsConfigs } = require('wix-preview-tester');

CLI - run refreshTestsConfigs (require install local and npm link)

npx wix-preview-tester

About

License:MIT License


Languages

Language:JavaScript 100.0%