Cypress Test
Framework to do all test(End-to-end; Integration; unit)
Installing
npm install
npm installInstall Cypress via npm:
cd /your/project/pathnpm install cypress --save-devyarn add
yarn addInstalling Cypress via yarn:
cd /your/project/pathyarn add cypress --devOpening Cypress
If you used npm to install, Cypress has now been installed to your ./node_modules directory, with its binary executable accessible from ./node_modules/.bin.
Now you can open Cypress from your project root one of the following ways:
The long way with the full path
./node_modules/.bin/cypress openOr with the shortcut using npm bin
Or by using npx
note: npx is included with npm > v5.2 or can be installed separately.
Or by using yarn
After a moment, the Cypress Test Runner will launch.

Switching browsers
The Cypress Test Runner attempts to find all compatible browsers on the user’s machine. The drop down to select a different browser is in the top right corner of the Test Runner.

Adding npm scripts
While there’s nothing wrong with writing out the full path to the Cypress executable each time, it’s much easier and clearer to add Cypress commands to the scripts field in your package.json file.
Now you can invoke the command from your project root like so:
…and Cypress will open right up for you.
Last updated