Skip to content

Commit 4fdc085

Browse files
committed
merge master
2 parents 9089821 + d52649e commit 4fdc085

File tree

1 file changed

+54
-76
lines changed

1 file changed

+54
-76
lines changed

README.md

+54-76
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,43 @@ npm install --save-dev netlify-plugin-cypress
1515
yarn add -D netlify-plugin-cypress
1616
```
1717

18-
And then add the plugin's name to the list of build plugins in `netlify.yml` file as shown in the examples below.
18+
And then add the plugin's name to the list of build plugins in `netlify.toml` file as shown in the examples below.
1919

2020
*note:* this plugin assumes you have already installed Cypress as a dev NPM dependency.
2121

2222
## Examples
2323

2424
### basic
2525

26-
Here is the most basic Netlify config file `netlify.yml` in YAML format with just Cypress plugin
27-
28-
```yaml
29-
plugins:
30-
# local Cypress plugin will test our site after it is built
31-
- package: netlify-plugin-cypress
32-
```
33-
34-
and its equivalent TOML format `netlify.toml`
26+
Here is the most basic [Netlify config file](https://docs.netlify.com/configure-builds/file-based-configuration/) `netlify.toml` with just the Cypress plugin
3527

3628
```toml
3729
[[plugins]]
30+
# local Cypress plugin will test our site after it is built
3831
package = "netlify-plugin-cypress"
3932
```
4033

4134
### recommended
4235

4336
We strongly recommend setting `CYPRESS_CACHE_FOLDER` to place the Cypress binary _inside the node_modules_ folder to [cache it between builds](https://on.cypress.io/caching)
4437

45-
```yaml
46-
build:
47-
command: "npm run build"
48-
publish: "build"
49-
environment:
50-
# do not show Cypress installation progress messages
51-
CI: 1
52-
# cache Cypress binary in local "node_modules" folder
53-
# so Netlify caches it
54-
CYPRESS_CACHE_FOLDER: "./node_modules/CypressBinary"
55-
# set TERM variable for terminal output
56-
TERM: "xterm"
57-
58-
plugins:
59-
# local Cypress plugin will test our site after it is built
60-
- package: netlify-plugin-cypress
38+
```toml
39+
[build]
40+
command = "npm run build"
41+
publish = "build"
42+
43+
[build.environment]
44+
# do not show Cypress installation progress messages
45+
CI = 1.0
46+
# cache Cypress binary in local "node_modules" folder
47+
# so Netlify caches it
48+
CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary"
49+
# set TERM variable for terminal output
50+
TERM = "xterm"
51+
52+
[[plugins]]
53+
# local Cypress plugin will test our site after it is built
54+
package = "netlify-plugin-cypress"
6155
```
6256

6357
See [netlify-plugin-cypress-example](https://github.com/cypress-io/netlify-plugin-cypress-example) repo
@@ -67,68 +61,52 @@ See [netlify-plugin-cypress-example](https://github.com/cypress-io/netlify-plugi
6761
To record test results and artifacts on Cypress Dashboard, set `record: true` plugin input and set `CYPRESS_RECORD_KEY` as an environment variable via Netlify Deploy settings.
6862

6963
```yaml
70-
# Netlify config file
71-
build:
72-
command: "npm run build"
73-
publish: "build"
74-
environment:
75-
# do not show Cypress installation progress messages
76-
CI: 1
77-
# cache Cypress binary in local "node_modules" folder
78-
# so Netlify caches it
79-
CYPRESS_CACHE_FOLDER: "./node_modules/CypressBinary"
80-
# set TERM variable for terminal output
81-
TERM: "xterm"
82-
83-
plugins:
84-
# local Cypress plugin will test our site after it is built
85-
- package: netlify-plugin-cypress
86-
inputs:
87-
record: true
64+
[build]
65+
command = "npm run build"
66+
publish = "build"
67+
[build.environment]
68+
# do not show Cypress installation progress messages
69+
CI = 1.0
70+
# cache Cypress binary in local "node_modules" folder
71+
# so Netlify caches it
72+
CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary"
73+
# set TERM variable for terminal output
74+
TERM = "xterm"
75+
76+
[[plugins]]
77+
# local Cypress plugin will test our site after it is built
78+
package = "netlify-plugin-cypress"
79+
[plugins.config]
80+
record = true
8881
```
8982

90-
See [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink/blob/master/netlify.toml) and recorded results at [![Cypress Dashboard](https://img.shields.io/badge/cypress-dashboard-brightgreen.svg)](https://dashboard.cypress.io/#/projects/4b7344/runs)
83+
See [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) and recorded results at [![Cypress Dashboard](https://img.shields.io/badge/cypress-dashboard-brightgreen.svg)](https://dashboard.cypress.io/#/projects/4b7344/runs)
9184

9285
### spec
9386

9487
Run only a single spec or specs matching a wildcard
9588

96-
```yaml
97-
# Netlify config file
98-
build:
99-
command: "npm run build"
100-
publish: "build"
101-
environment:
102-
# do not show Cypress installation progress messages
103-
CI: 1
104-
# cache Cypress binary in local "node_modules" folder
105-
# so Netlify caches it
106-
CYPRESS_CACHE_FOLDER: "./node_modules/CypressBinary"
107-
# set TERM variable for terminal output
108-
TERM: "xterm"
109-
110-
plugins:
111-
# local Cypress plugin will test our site after it is built
112-
- package: netlify-plugin-cypress
113-
inputs:
114-
spec: 'cypress/integration/smoke*.js'
115-
```
116-
117-
See [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink/blob/master/netlify.toml) for instance.
118-
119-
## toml
120-
121-
You can write Netlify configuration file using TOML format, and then configure the plugin as
122-
12389
```toml
124-
# build and build environment settings ...
90+
[build]
91+
command = "npm run build"
92+
publish = "build"
93+
[build.environment]
94+
# do not show Cypress installation progress messages
95+
CI = 1.0
96+
# cache Cypress binary in local "node_modules" folder
97+
# so Netlify caches it
98+
CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary"
99+
# set TERM variable for terminal output
100+
TERM = "xterm"
125101

126102
[[plugins]]
127-
package = "netlify-plugin-cypress"
128-
inputs = { spec = 'cypress/integration/examples/w*.js', record = true }
103+
# local Cypress plugin will test our site after it is built
104+
package = "netlify-plugin-cypress"
105+
[plugins.config]
106+
spec = "cypress/integration/smoke*.js"
129107
```
130108

131-
See [cypress-example-kitchensink netlify.toml](https://github.com/cypress-io/cypress-example-kitchensink/blob/master/netlify.toml)
109+
See [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) for instance.
132110

133111
## Debugging
134112

0 commit comments

Comments
 (0)