Skip to content

Commit 2992dac

Browse files
MarcLoupiasjennifer-shehane
authored andcommitted
Installing Cypress guide improvment (#221)
* Installing Cypress guide improvment closes #200, closes #218 and closes cypress-io/cypress#866 * npm install section clarification - what is the npm package - best practice highlighted * direct download section precisions - what is exactly downloaded as the user didn't knew it exactly * new CDN Structure section - CDN url pattern - it give to the user enough informations to download Cypress in the wanted version for the wanted platform (could download a linux Cypress version from a windows workstation) - example * Advanced section - warning added about CLI output when running cypress * updates to new advanced instructions - Some wording changes - Moved CDN section into section called ‘Hosting’ within the Advanced install instructions. - Added the download table (we only want to expose our download.cypress.io endpoint, not the cdn directly) - update platforms to correct os names.
1 parent 9575397 commit 2992dac

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

source/guides/getting-started/installing-cypress.md

+45-4
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,27 @@ cd /your/project/path
3434
npm install cypress --save-dev
3535
```
3636

37-
This will install Cypress locally as a dev dependency for your project. We recommend this approach because:
37+
This will install Cypress locally as a dev dependency for your project.
38+
39+
{% img /img/guides/installing-cli.gif %}
40+
41+
{% note info %}
42+
Notice that the Cypress `npm` package is a wrapper around the Cypress binary. The version of the `npm` package determines the version of the binary downloaded.
43+
{% endnote %}
44+
45+
{% note success Best Practice %}
46+
47+
The recommended approach is to install Cypress with `npm` because :
3848

3949
- Cypress is versioned like any other dependency.
4050
- It simplifies running Cypress in {% url 'Continuous Integration' continuous-integration %}.
41-
42-
{% img /img/guides/installing-cli.gif %}
51+
{% endnote %}
4352

4453
## {% fa fa-download %} Direct Download
4554

46-
If you're not using `node` or `npm` in your project or you just want to try Cypress out quickly, you can always {% url "download Cypress directly here" http://download.cypress.io/desktop %}.
55+
If you're not using `node` or `npm` in your project or you just want to try Cypress out quickly, you can always {% url "download Cypress directly from our CDN" http://download.cypress.io/desktop %}.
56+
57+
The direct download will always grab the latest available version. Your platform will be detected automatically.
4758

4859
Just manually unzip and double click. Cypress will run without needing to install any dependencies.
4960

@@ -111,6 +122,8 @@ You can {% url 'read more about the CLI here' command-line %}.
111122

112123
# Advanced
113124

125+
## Environment Variables
126+
114127
Using an environment variable you can control how Cypress is installed.
115128

116129
This is helpful if you want to:
@@ -142,3 +155,31 @@ To override what is installed, you simply set `CYPRESS_BINARY_VERSION` with the
142155
```
143156

144157
In all cases, the fact that the binary was installed from a custom location *is not saved* in your `package.json` file. Every repeated installation would have to use the same environment variable to install the same binary.
158+
159+
{% note warning Note %}
160+
Setting the `CYPRESS_BINARY_VERSION` to a URL or local path will always display a warning message when opening. This is normal as the Cypress CLI cannot match the binary version with the `npm` package version.
161+
{% endnote %}
162+
163+
## Hosting
164+
165+
If you want to download a specific Cypress version for a given platform, you can get it from our CDN.
166+
167+
You may want to do this if you want to host Cypress yourself and serve it from a local network.
168+
169+
The download server url is `https://download.cypress.io`.
170+
171+
Method | Url | Description
172+
------ | --- | -----------
173+
`GET` | `/desktop ` | Download latest desktop app
174+
`GET` | `/desktop?platform=p ` | downloads latest desktop app for specific platform
175+
`GET` | `/desktop.json ` | returns desktop manifest.json
176+
`GET` | `/desktop/:version` | downloads desktop app by version
177+
`GET` | `/desktop/:version?platform=p` | downloads desktop app by OS which could be `darwin`, `win32` or `linux64`
178+
179+
{% note info "Example:" %}
180+
`https://download.cypress.io/desktop/1.0.1?platform=win32`
181+
182+
This will download Cypress `1.0.1` for Windows platform.
183+
{% endnote %}
184+
185+
If you don't provide a platform, it will be detected automatically.

0 commit comments

Comments
 (0)