Skip to content

Commit 1ef224c

Browse files
authored
feat: add onSuccess testing (#108)
1 parent d77959b commit 1ef224c

File tree

7 files changed

+226
-90
lines changed

7 files changed

+226
-90
lines changed

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true
6+
}

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# netlify-plugin-cypress [![CircleCI](https://circleci.com/gh/cypress-io/netlify-plugin-cypress/tree/master.svg?style=svg&circle-token=9cbb587a5a0ae4ce28b011dd03d10d66de906708)](https://circleci.com/gh/cypress-io/netlify-plugin-cypress/tree/master) [![renovate-app badge][renovate-badge]][renovate-app] [![netlify-plugin-cypress](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/ixroqc/master&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/ixroqc/runs)
1+
# netlify-plugin-cypress
2+
[![CircleCI](https://circleci.com/gh/cypress-io/netlify-plugin-cypress/tree/master.svg?style=svg&circle-token=9cbb587a5a0ae4ce28b011dd03d10d66de906708)](https://circleci.com/gh/cypress-io/netlify-plugin-cypress/tree/master) [![renovate-app badge][renovate-badge]][renovate-app] [![netlify-plugin-cypress](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/ixroqc/master&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/ixroqc/runs) [![Netlify Status](https://api.netlify.com/api/v1/badges/76892baf-2ad8-4642-b283-f2135963ff51/deploy-status)](https://app.netlify.com/sites/sad-lumiere-6a00a5/deploys)
23
> Runs Cypress end-to-end tests after Netlify builds the site but before it is deployed
34
45
**Note:** currently the built site is served statically and tested _without proxying redirects_.
@@ -72,6 +73,19 @@ publish = "build"
7273
# ...remaining configuration...
7374
```
7475

76+
### testing deployed url
77+
78+
After successful deployment you can run tests against the `DEPLOY_PRIME_URL` provided by the Netlify system.
79+
80+
```toml
81+
[[plugins]]
82+
package = "netlify-plugin-cypress"
83+
[plugins.inputs.onSuccess]
84+
enable = true
85+
```
86+
87+
The following parameters can be used with "onSuccess" tests: `record`, `group`, `tag`, `spec`.
88+
7589
### recording
7690

7791
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.

manifest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ inputs:
1616
# and waiting for an url, record to the dashboard, tag, etc
1717
# see README "testing the site before build"
1818
- name: preBuild
19+
20+
# you can control how the plugin runs the tests after deploy
21+
- name: onSuccess

netlify.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ publish = "public"
1616
# start = 'npm start'
1717
# wait-on = 'http://localhost:5000'
1818
# wait-on-timeout = '3' # seconds
19+
[plugins.inputs.onSuccess]
20+
enable = true
21+
record = true
22+
group = 'deployed'

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"devDependencies": {
4141
"cypress": "6.4.0",
4242
"netlify-cli": "3.5.0",
43+
"prettier": "2.2.1",
4344
"react": "16.13.1",
4445
"react-dom": "16.13.1",
4546
"react-router-dom": "5.2.0",

0 commit comments

Comments
 (0)