You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
19
19
20
20
*note:* this plugin assumes you have already installed Cypress as a dev NPM dependency.
21
21
22
22
## Examples
23
23
24
24
### basic
25
25
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
35
27
36
28
```toml
37
29
[[plugins]]
30
+
# local Cypress plugin will test our site after it is built
38
31
package = "netlify-plugin-cypress"
39
32
```
40
33
41
34
### recommended
42
35
43
36
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)
44
37
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
# local Cypress plugin will test our site after it is built
54
+
package = "netlify-plugin-cypress"
61
55
```
62
56
63
57
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
67
61
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.
68
62
69
63
```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
# local Cypress plugin will test our site after it is built
78
+
package = "netlify-plugin-cypress"
79
+
[plugins.config]
80
+
record = true
88
81
```
89
82
90
-
See [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink/blob/master/netlify.toml) and recorded results at [](https://dashboard.cypress.io/#/projects/4b7344/runs)
83
+
See [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) and recorded results at [](https://dashboard.cypress.io/#/projects/4b7344/runs)
91
84
92
85
### spec
93
86
94
87
Run only a single spec or specs matching a wildcard
95
88
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
0 commit comments