Just another rendering test example project to run Nightwatch test on BrowserStack infrastructure.
nightwatch-browserstack-example
├── src/
├── test/
├── README.md # This file
├── base.nightwatch.conf.js # base nightwatch configuration
├── local.nightwatch.conf.js # to run tests on local machine
├── browserstack.nightwatch.conf.js # to run tests on BrowserStack
├── browserstack.launchers.conf.js # Browser lists to test
├── webpack.config.js
└── package.json
visual
├── html/ # Rendering Test HTML
├── nightwatch/ # Custom commands for Nightwatchjs
├── reports/ # Test Report
├── screenshots/ # Test Resource
│ ├── baseline # Expect
│ ├── diffs # Diff
│ └── results # Actual
└── spec/ # Test Case
- Boot up static server at port between 50000 and 59999
- Open each HTML file in
test\visual\html - Take page screenshot
- Compare to
baseline - Pass if the mismatch ratio is under 10%
- Run test on local:
npm run test:visual:local - Run test on BrowserStack:
npm run test:visual:ci