* appveyor build for this branch * don't force install ffmpeg on windows don't force install ffmpeg on windows * derp * fix * build in appveyor * oops * delete using del * use RMDIR instead of DEL * only build 32-bit * build for x64 and x86 windows * separate win32 and win64 * require lodash * make electron arch configurable * cross-compile 32, only run in 64-bit * force install ffmpeg if necessary * it's all win10 x64, but we can force it to build for ia32 in x32 mode * add windows util * who's idea was it to make whitespace meaningful? * pass arch to npm install, pass arch to uploader * add TARGET_PLATFORM * fun fact: appveyor titlecases env var names fun fact: appveyor titlecases env var names * fix: pass args * use process * cli: use arch package to send arch to server * pass TARGET_ARCH to all npm installs * run-all * always call getUploadNameByOs * use the precise version of node, enable both x64 and ia32 arch * quotes * uh wat * move console logs to script because windows * add yet another env var to install the right node arch * use x86, not x32 * give ia32 a try, why not * use platform env again * and also try x86 again * remove notion of target_arch since we're using the right node version with arch set correctly * more comprehensive checks to ensure the arch is correct * simplify building the binary, do not accept arch as options * build the binary and test it on this branch * remove arch, ensure that process.env.Platform is set to x86 * do build the binary unless this is a forked PR * attempt to verify that this is a 32bit or 64bit windows binary * remove unused dep * consolidate commands * don't install packages in windows - just build the binary - this avoids needing to reinstall all node_modules and build-js twice * build the binary on more branches * cd up appveyor * ugh * right logic for whether or not this is a forked PR * remove unused deps * fix undefined var * platformArch * set in options * turns out we do have to npm install before building the binary * options.platformArch * comment out appveyor build 32bit/64bit verification temporarily Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Server
The server 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 driver packages
- 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 packages of Cypress.
Installing
The server's dependencies can be installed with:
cd packages/server
npm install
Developing
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 -watch 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
## works for integration tests too
npm run test ./test/integration/server_spec.coffee
You can also run a single test in watch mode.
## runs and watches only this one test file
npm run test-watch ./test/unit/api_spec.coffee
To run an individual e2e test:
## runs tests that match "base_url"
npm run test-e2e -- --spec base_url
To update snapshots, see snap-shot-it instructions: https://github.com/bahmutov/snap-shot-it#advanced-use