Files
cypress/packages/desktop-gui
Chris Breiding e93e6ae0b4 Validate plugin event registration (#5356)
* Turn exception message into something human readable

* Pass ipc as parameter to invoke function

* Creating file to validate event name and handler

* Creating tests to validate_event

* Remove ipc from invoke parameter

* Removing ipc parameter being passed to validateEvent

* convert spec to js

* increase line-height for plugins error message

* refactor error messages and implementation

* fix race condition where async error in plugins file could hang run

a quick async error at the root of the plugins file had the potential to hang the run because the ‘exitEarlyWithErr’ listener was registered later than that error was emitted

this enables that error to be tracked so we can properly exit at the appropriate time

it also refactors run.js to not rely on an event emitted on the project and instead passes through an onError handler, which makes more sense since the event was only used in run.js (except for one case). it also makes for easier unit testing

* fix missing reference

* fix duplicate reference

* fix args being passed in incorrectly

* fix way args were handled in server.open

* fix exit early implementation

* fix duplicate logging

* fix unit test

* update snapshot

* fix missing reference

* add e2e test to cover plugin registration validation

* clean up after merge

* add back snapshot

* fix e2e tests

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-03-05 16:00:42 -05:00
..
2020-02-11 12:40:07 +06:30
2020-01-27 23:10:26 +06:30

Desktop GUI

The Desktop GUI is the react application that is rendered by Electron. This acts as the visual user interface you see when running: cypress open.

screen shot 2017-12-07 at 11 13 45 am

The Desktop GUI has the following responsibilities:

  • Allow users to log in through GitHub.
  • Allow users to add projects to be tested in Cypress.
  • Display existing projects and allow the removal of projects.
  • Initialize the server to run on a specific project.
  • Allow users to choose a specific browser to run tests within.
  • Display the resolved configuration of a running project.
  • Display the list of specs of a running project.
  • Initialize the run of a specific spec file or all spec files chosen by the user.
  • Notify users of updates to Cypress and initialize update process.
  • Set up projects to be recorded.

Building

For development

## from repo root
yarn build --scope @packages/desktop-gui

For production

## from repo root
yarn build-prod --scope @packages/desktop-gui

Developing

NOTE: Currently, if you want to work on the code around logging in, viewing runs, or setting up new projects to record, this requires connecting to a locally running API server.

Our API server is only accessible to Cypress employees at the moment. If you want to work with the code, we recommend working within the Cypress tests for the Desktop-Gui. There are lots of tests mocking our API server around logging in, seeing runs, and setting up projects.

Watching

This watches and compiles all changes as you make them.

  • Runs *.js and *.jsx through babel and bundles with browserify into dist
  • Compiles *.scss files into dist
## from repo root
yarn watch --scope @packages/desktop-gui

Running

You can also run all of the Desktop GUI'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.

## from repo root
yarn lerna run cypress:run --scope @packages/desktop-gui --stream

Testing

In Cypress

This project is tested with Cypress itself. It acts exactly like any other Cypress project.

## from repo root
yarn lerna run cypress:open --scope @packages/desktop-gui --stream