mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-25 08:29:06 -06:00
* erver: fixes #442 implements blacklisting hosts with config * server: add validation rules for blacklistHosts * server: fix bad cherrypick / merge for WIP feature * server: enable passing exit false to prevent browser teardown on completed runs * server: add e2e tests for blacklists, fix edge case where blacklisted localhost was causing ws connection issues * server: add snapshot for blacklist e2e test
Server
This is the heart of the Cypress application. All of this code represents the node process running behind the browser application. This node process is responsible for:
- Proxying every byte coming in and out of the browser
- Performing and normalizing automation tasks for each browser
- Coordinating and synchronizing state with the Desktop GUI and the Driver
- Performing node specific tasks on behalf of the Driver
- Instantiating and orchestrating nearly every other layer and package
- Spinning up various static file and http servers
- Communicating with our external API's
- Recording videos of run
- Managing mocha reporters
- Managing 3rd party plugins
The Driver and the Server are the two most complex areas of the Cypress.
Install
The server's dependencies can be installed with:
cd packages/server
npm install
Development
To run Cypress:
npm start ## boots the entire Cypress application
Since the server controls nearly every aspect of Cypress, after making changes you'll need to manually restart Cypress.
Since this is slow, it's better to drive your development with tests.
Testing
npm run test-unitexecutes unit tests intest/unitnpm run test-integrationexecutes integration tests intest/integrationnpm run test-e2eexecutes the large (slow) end to end tests intest/e2e
Each of these tasks can run in "watch" mode by appending this word to the task:
npm run test-unit-watch
Because of the large number of dependencies of the server, it's much more performant to run a single individual test.
## runs only this one test file
npm run test ./test/unit/api_spec.coffee
You can also run in watch mode
## runs and watches only this one test file
npm run test-watch ./test/unit/api_spec.coffee