- OSX Ventura with Git and Brew
- Linux with bash curl and git
- Windows with NodeJS 18 (untested)
- Sauce Labs Account
- Install Node.js 18 on Mac:
brew install node@18
- Install Node.js 18 on Linux:
curl -fsSLO https://deb.nodesource.com/nsolid_setup_deb.sh
chmod +x nsolid_setup_deb.sh
./nsolid_setup_deb.sh 18
apt-get install nodejs -y
- Clone the repo:
git clone https://github.com/saucelabs/visual-examples
cd visual-examples/wdio
- install npm dependencies:
npm install
- Configure with your Sauce credentials from https://app.saucelabs.com/user-settings and run
export SAUCE_USERNAME=__YOUR_SAUCE_USER_NAME__
export SAUCE_ACCESS_KEY=__YOUR_SAUCE_ACCESS_KEY__
# to change the region you are testing in please change the `hostname property in the wdio.conf.ts file
- Run the test
desktop
npm run sauce-visual
or mobile
npm run sauce-visual-mobile
- Review your screenshots by clicking on the url printed in the test or go to https://app.saucelabs.com/visual/builds.
- Accept all diffs, so they become new baselines.
- Re-run the tests
desktop
npm run sauce-visual-check
or mobile
npm run sauce-visual-check-mobile
NOTE: By default the tests will be executed on the US DC, if you want to run them on the EU DC then please run the following command
SAUCE_REGION=eu-central-1 npm run sauce-visual
or
SAUCE_REGION=eu-central-1 npm run sauce-visual-check
- Open the test or go to https://app.saucelabs.com/visual/builds to review changes.
View installation and usage instructions on the Sauce Docs website.