* update packages/server readme file

* update server and desktop-gui readmes
This commit is contained in:
Gleb Bahmutov
2017-10-03 19:58:04 +00:00
committed by GitHub
parent 5d91b53039
commit e34e20a8a9
2 changed files with 19 additions and 378 deletions
+8 -165
View File
@@ -1,8 +1,6 @@
# Cypress Core Desktop Gui [![CircleCI](https://circleci.com/gh/cypress-io/cypress-core-desktop-gui.svg?style=svg)](https://circleci.com/gh/cypress-io/cypress-core-desktop-gui)
# packages/desktop-gui
![core-desktop-gui](https://cloud.githubusercontent.com/assets/1271364/18134339/0fab0644-6f6c-11e6-8816-5d4528de6108.png)
The desktop GUI is the desktop application [installed](https://on.cypress.io/installing-cypress) to the user's OS using the `cypress install` command from the [Cypress CLI](https://on.cypress.io/cli) or through [direct download](http://download.cypress.io/desktop).
The desktop GUI is the desktop application installed to the user's OS.
The desktop GUI has the following responsibilities:
@@ -16,168 +14,13 @@ The desktop GUI has the following responsibilities:
- Initializing the run of a specific test file or all tests chosen by the user.
- Notifying users of updates to Cypress and initializing update process.
## Install
## Development
Root install is preferred (see `CONTRIBUTING.md`), but if you must
### Lint
* `npm install`
* `npm run build`
```bash
npm run lint
```
## Testing
### Building
#### For development
```bash
npm run build
```
#### For production
```bash
npm run build-prod
```
### Watching
```bash
npm run watch
```
### Testing
```bash
npm test-once
```
### Debugging
If you want to see the `ipc` events which are pending from Cypress tests:
- Switch to 'Your App' frame
- App.ipc() <-- returns you object with pending events
## License
MIT
## Changelog
#### 0.4.9 - *(04/20/17)*
- bump cypress deps
#### 0.4.8 - *(04/14/17)*
- properly await browser closing
- new spec data structure
#### 0.4.7 - *(04/12/17)*
- colorize browser icons
- display browser tooltip + icon
- update ipc events
#### 0.4.6 - *(03/07/17)*
- provide help links to explain orgs + access
#### 0.4.5 - *(02/11/17)*
- added --record flag
#### 0.4.4 - *(02/11/17)*
- more slug renaming
#### 0.4.3 - *(02/10/17)*
- updated content
- renamed slugs
#### 0.4.2 - *(02/10/17)*
- merged missed PR
#### 0.4.1 - *(02/10/17)*
- display runs
- new settings areas
- request access
- add project to Dashboard
#### 0.4.0 - *(01/04/17)*
- builds list, adding project for ci
#### 0.3.15 - *(01/29/17)*
- display all scaffolded files
#### 0.3.14 - *(01/29/17)*
- LGPL -> MIT
- correctly replace new lines on errors
- rename sessionToken -> authToken
- display full list of scaffolded files
#### 0.3.13 - *(11/15/16)*
- camelize session token
#### 0.3.12 - *(11/14/16)*
- fix missing lib js file
#### 0.3.11 - *(11/14/16)*
- updated config to display 'env' property instead of inaccurately named 'environmentVariables' property
#### 0.3.10 - *(10/14/16)*
- missing lib folder
#### 0.3.9 - *(10/14/16)*
- fixed errors with undefined values being called
#### 0.3.8 - *(10/13/16)*
- explain how to manually update cypress during update fail
#### 0.3.7 - *(10/05/16)*
- shrinkwrap to prevent breaking dep change
#### 0.3.6 - *(10/03/16)*
- deploy proper prod files, fix mobx action undefined values
#### 0.3.5 - *(09/13/16)*
- previously chosen browser is saved per user and selected by default
#### 0.3.4 - *(08/31/16)*
- fix github focus button
#### 0.3.3 - *(08/30/16)*
- added applying updates view
#### 0.3.2 - *(08/30/16)*
- fixes dist dir and updates.html
#### 0.3.1 - *(08/30/16)*
- fix for incorrect references in index.html
#### 0.3.0 - *(08/30/16)*
- new UI, migrated to react
#### 0.2.2
- renamed Login -> Log In
#### 0.2.1
- internal updates to cypress.json settings change notification
#### 0.2.0
- display list of launchable browsers
- handle error when no browsers available
#### 0.1.5
- updated node version to 5.10.0
#### 0.1.4
- added link to gitter chat in options popup
#### 0.1.3
- added specific error msg and link to docs on unauthed login
#### 0.1.2
- updated license
#### 0.1.1
- renamed to cypress-core-desktop-gui
- removed dead code
#### 0.1.0
- initial release
This project does not have its own tests, but instead is tested by `packages/server`
+11 -213
View File
@@ -1,219 +1,17 @@
# Cypress App [![Circle CI](https://circleci.com/gh/cypress-io/cypress-app.svg?style=shield&circle-token=a6d67217ee174805c91925400b4210ada937def9)](https://circleci.com/gh/cypress-io/cypress-app)
# packages/server
## First Time Installs
> The ❤️ of Cypress application.
> Controls every part of the test running process.
```bash
npm install -g bower
```
## Install
## Development
Root install is preferred (see `CONTRIBUTING.md`), but if you must
```bash
## Install project dependencies
npm install
```
* `npm install`
* `npm run build`
```bash
## Watch all project files and build as necessary
npm run watch
```
## Testing
Now, you have a few options to boot Cypress:
1. Boot the Desktop Application in GUI mode.
2. Run a project directly from the command line.
3. Run a project headlessly.
### 1. GUI Mode
```bash
## this will boot the desktop app and
## display the 'cy' in your tray
npm start
```
Code changes which are applied instantly:
- `web app`
- `driver`
Code changes which require you to restart the running process:
- `server`
> When running in GUI mode you'll notice you may get a warning in your console:
*The local API server isn't running in development. This may cause problems running the GUI.*
To avoid this warning make sure you start your API server.
```bash
## Start the API Server
cd cypress-api
npm start
```
### 2. Run project directly without GUI
```bash
## boot a specific project
npm run server -- --run-project <path-to-the-project-you-want-to-test>
```
You should see `nodemon` watching all of your files.
Code changes are applied instantly:
- `web app`
- `driver`
- `server`
### 3. Run project headlessly
```bash
## boot a specific project
npm start -- --run-project <path-to-the-project-you-want-to-test>
```
You will see Cypress run all the tests headlessly and you'll see output in your console.
### 4. Run a single spec headlessly
```bash
npm start -- --run-project <path to project> --spec <path to spec file>
```
Path to spec file can be relative to the project you want to test.
## Testing the Driver
To run driver tests:
- Navigate to the directory where the `cypress-app` project is on your computer.
- Run the following commands:
```bash
gulp test
```
Navigate to [http://localhost:3500](http://localhost:3500)
## Debugging
Using [debug](https://github.com/visionmedia/debug#readme) module under
namespace `cypress:server`. There are a few places where low-level events are
also written, for example `cypress:server:file`. To see debug messages
```sh
DEBUG=cypress:server npm start ...
```
You can see more debug messaging by using a wild card
```sh
DEBUG=cypress* npm start ...
```
## Deploying
```bash
npm run deploy
```
## Releasing
```bash
npm run release
```
## Rolling back
```bash
npm run release -- --version 0.9.6
```
If the user just updated their old app will be in their trash bin. They could always delete the new app and "put back" their trashed app.
### Manually Completing An Update
This will manually complete an update given you have the new app downloaded and unzipped (which is the source), and you have the existing app (the destination).
This will copy the new (source) app to the existing (desination) app, and trash the existing (destination) app first.
```bash
open <path-to-new-cypress.app> --args --app-path <path-to-existing-app-path> --exec-path <path-to-existing-exec-path> --updating
```
Real example with paths:
```bash
open ~/Desktop/cypress.app --args --app-path /Users/bmann/Dev/cypress-app/build/0.5.8/osx64/cypress.app --exec-path /Users/bmann/Dev/cypress-app/build/0.5.8/osx64/cypress.app --updating
```
## Remote Server Communication
### To Connect
Remote servers need to connect to the web socket server:
In my `node.js` adapter, the remote server with this:
```js
socket = require("socket.io-client")("http://localhost:2020", {path: "/__socket.io"})
```
### Connecting to the `remote` room
Upon connecting to the websocket server you'll need to request to be put in the `remote` room. This allows the websocket server to know you're listening to requests.
To do that, emit a `remote:connected` message.
```js
socket.emit("remote:connected")
```
You are now connected properly and ready to receive messages.
### How messages are passed in and out
Client requests a message:
```js
// passes in a message and optionally some JSON data
cy.message("create:user", {some: "data"})
```
Desktop App requests message from remote server:
```js
// an unique guid ID is generated for this message
// and the desktop app broadcasts the 'remote:request' event
// and passes the ID, message, and optional data params
io.emit("remote:request", "123-a-guid-as-an-id", "create:user", {some: "data"})
```
Remote server responds:
```js
// the remote server performs the work as per the message implementation
// and when its done it sends back a remote:response message
// and passes back the same GUID ID, as well as the new JSON response data
socket.emit("remote:response", "123-a-guid-as-an-id", {a: "new response data obj"})
```
### Debugging Linux (Desktop)
- `vagrant halt`
- Modify Vagrantfile, comment out `vm.box` and uncomment `vm.define desktop`
- `vagrant up`
- `.vagrant/ssh` can be edited in sublime and takes effect immediately
- Open `terminal` on the desktop
- `cd /cypress_app`
- `npm i`
- Open new tab: `npm run watch`
- `node_modules/.bin/nw .`
## Misc
**important** do not use sync file system methods to work with files. They can fail if
there are too many files (the `EMILE` exception). Asynchronous file system methods
all use [graceful-fs](https://github.com/isaacs/node-graceful-fs#readme) to retry and
get around this problem.
* there is `fs.pathExists(filename)` method that is returning a promise, use that
instead of `fs.exists` or `fs.existsSync`.
* `npm run test-unit` executes unit tests (see `test/unit` folder)
* `npm run test-integration` executes integration tests
* `npm run test-e2e` executes the large (slow) end to end tests