This is the core JavaScript library that is loaded inside the browser that is responsible for executing Cypress commands and managing the test runtime.
The driver's dependencies can be installed with:
cd packages/driver
npm install
The driver is actually consumed by the runner
like any other npm module. To develop the driver and see changes reflected you need to run the watch
task inside of the runner.
cd packages/runner
npm run watch
If you're developing on the driver, you'll want to run in the normal Cypress GUI mode, like you would when you're writing tests for your own Cypress projects.
## run in cypress GUI mode
cd packages/driver
npm run cypress:open
Read the runner's README.md
for more information.
You can also run all of the driver's tests locally. We don't really recommend this because it takes a long time, and we have this process optimized by load balancing the tests across multiple workers in CI.
It's usually easier to run the tests in the GUI, commit, and then see if anything broke elsewhere.
## run all the tests
npm run cypress:run
This project is tested with Cypress itself. It acts exactly like any other Cypress project (really we're not kidding!).
The driver uses a node server to test all of its edge cases, so first start that.
## boot the driver's server
cd packages/driver
npm start
For working with a single spec file, use testFiles
configuration option. For example, to only show the e2e/focus_blur_spec.js
spec file when Cypress is opened use (path is relative to test/cypress/integration
folder)
npm run cypress:open -- --config testFiles=e2e/focus_blur_spec.js
Or to run that single spec headlessly
npm run cypress:run -- --config testFiles=e2e/focus_blur_spec.js
Alternative: use --spec
, but pass the path from the current folder, for example
npm run cypress:run -- --spec test/cypress/integration/issues/1939_1940_2190_spec.js --browser chrome
If you want to run tests in Chrome and keep it open after the spec finishes, you can do
npm run cypress:run -- --config testFiles=e2e/focus_blur_spec.js --browser chrome --no-exit
If you would like to run a particular integration test, see the GUI and poke around during the test, you can an exclusive test like:
```bash
cd packages/driver
npm run cypress:run -- \
--spec test/cypress/integration/cypress/cy_spec.coffee \
--headed \
--no-exit
In the browser
localStorage.debug = "cypress:driver"