Skip to content

Latest commit

 

History

History
106 lines (72 loc) · 2.58 KB

README.md

File metadata and controls

106 lines (72 loc) · 2.58 KB

Getting started with Cypress

Prerequisites

  • OSX Ventura with Git and Brew
  • Linux with bash curl and git
  • Windows with NodeJS 18 (untested)
  • Sauce Labs Account

Run the demo

  • Install Node.js 18 on Mac:
brew install node@18
  • Install Node.js 18 + Dependencies 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
apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
  • Clone the repo:
git clone https://github.com/saucelabs/visual-examples
cd visual-examples/cypress
  • install npm dependencies:
npm install
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 `region` property in the cypress.config.ts file.
  • Run the test
npm run sauce-visual
npm run sauce-visual-check

Running with saucectl

Alternatively, you can run your tests on Sauce Labs.

  • Install saucectl
npm install saucectl
  • Install the plugin in your .sauce/config.yml
[...]

npm:
  packages:
    "@saucelabs/cypress-visual-plugin": "^0.3.33"

[...]
  • Run saucectl
npx saucectl run
  • 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.

  • Run saucectl (with a modified screen)

VISUAL_CHECK=true npx saucectl run

Installation & Usage

View installation and usage instructions on the Sauce Docs website.