Skip to content

Commit 2afe844

Browse files
committed
feat: rework test phases to make onSuccess default
BREAKING CHANGE: now the onSuccess step is the default testing step, running the Cypress tests against the preview or production deploy. Another change is the default browser is Chromium instead of Electron.
1 parent aff5471 commit 2afe844

File tree

2 files changed

+40
-15
lines changed

2 files changed

+40
-15
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ package = "netlify-plugin-cypress"
177177

178178
See [cypress-example-kitchensink](https://github.com/cypress-io/cypress-example-kitchensink) for instance.
179179

180-
### Chromium
180+
### browser
181181

182-
By default all tests run using built-in Electron browser. If you want to use Chromium:
182+
By default all tests run using Chromium browser. If you want to use Electron:
183183

184184
```toml
185185
[build]
@@ -195,7 +195,8 @@ publish = "build"
195195
[[plugins]]
196196
package = "netlify-plugin-cypress"
197197
[plugins.inputs]
198-
browser = "chromium"
198+
# allowed values: electron, chromium
199+
browser = "electron"
199200
```
200201

201202
### testing SPA routes
@@ -294,6 +295,12 @@ Name | Description
294295
[bahmutov/eleventyone](https://github.com/bahmutov/eleventyone) | Example used in [Test Sites Deployed To Netlify Using netlify-plugin-cypress](https://glebbahmutov.com/blog/test-netlify/) tutorial
295296
[gatsby-starter-portfolio-cara](https://github.com/bahmutov/gatsby-starter-portfolio-cara) | A Gatsby site example
296297

298+
## Major upgrades
299+
300+
### v1 to v2
301+
302+
- The default browser has been switched to Chromium. If you want to use the built-in Electron use an explicit option [browser](#browser)
303+
297304
## Debugging
298305

299306
Set environment variable `DEBUG=netlify-plugin-cypress` to see the debug logs. To see even more information, set `DEBUG=netlify-plugin-cypress,netlify-plugin-cypress:verbose`

manifest.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
11
name: netlify-plugin-cypress
22
inputs:
3-
# these settings apply during postBuild step
4-
# when we are testing the site served from the distribution folder
3+
# these settings apply during onSuccess step
4+
- name: enable
5+
description: Run tests against the preview or production deploy
6+
default: true
7+
58
- name: record
9+
description: Record test results to Cypress Dashboard
610
default: false
11+
712
- name: spec
13+
description: |
14+
Run just the given spec or spec pattern,
15+
equivalent to "cypress run --spec ..."
16+
817
- name: group
18+
description: |
19+
If recording to Cypress Dashboard,
20+
pass the group name with "cypress run --record --group ..."
21+
922
- name: tag
10-
- name: spa
11-
# by default run the tests
12-
- name: skip
13-
default: false
14-
# by default the tests run in Electron
15-
# but because of the dependency we download Chromium
16-
# so you can set "browser = electron"
23+
description: |
24+
If recording to Cypress Dashboard,
25+
pass the tag with "cypress run --record --tag ..."
26+
27+
# Cypress comes with built-in Electron browser
28+
# and this NPM package installs Chromium browser
1729
- name: browser
18-
default: electron
30+
description: Allowed values are chromium, electron
31+
default: chromium
1932

2033
# tells the plugin how to start the server using custom command
2134
# and waiting for an url, record to the dashboard, tag, etc
2235
# see README "testing the site before build"
2336
- name: preBuild
37+
description: Run tests before building the site
2438

25-
# you can control how the plugin runs the tests after deploy
26-
- name: onSuccess
39+
# tells the plugin to start a static server during postBuild
40+
# and test just the built static site.
41+
# see README "testing the site after build"
42+
# NOTE: does not execute Netlify API redirects or functions
43+
- name: postBuild
44+
description: Run tests against the built static site

0 commit comments

Comments
 (0)