Skip to content

Commit 96ee911

Browse files
committed
readme: explain the steps, closes #143
1 parent 3c7bcf3 commit 96ee911

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,31 @@ This plugin installs [via Puppeteer](https://github.com/puppeteer/puppeteer) Chr
2424

2525
## How does it work
2626

27-
When Netlify Build runs, it calls the plugin `netlify-plugin-cypress` before and after the build, and after the deployment. The plugin runs the Cypress tests using its [NPM module API](https://on.cypress.io/module-api) against the local folder or against the deployed URL.
27+
### Build steps
28+
29+
When Netlify Build system runs it performs 2 steps essentially:
30+
31+
1. builds the site
32+
2. deploys the site
33+
34+
Every plugin that wants to perform some actions can do so before the build, after the build (but before the deploy), and after the deploy. The Netlify uses the following names for these events
35+
36+
```
37+
"preBuild"
38+
1. builds the site
39+
"postBuild"
40+
2. deploys the site
41+
"onSuccess"
42+
"onFailure"
43+
```
44+
45+
Thus every plugin can register itself to be executed before a site is built using "preBuild" event, or after a successful deploy using "onSuccess" event name, etc.
46+
47+
### This plugin
48+
49+
This plugin `netlify-plugin-cypress` by default runs during the "onSuccess" event, testing the deployed site. The Netlify Build system gives the URL to the plugin and it runs Cypress against that URL using the [Cypress NPM module API](https://on.cypress.io/module-api).
50+
51+
Optionally, you can also run tests during "preBuild" and "postBuild" steps. This is useful if you want to ensure the site is working even before deploying it to Netlify servers. Finally, this plugin does not use "onFailure" event which happens only if Netlify fails to deploy the site.
2852

2953
## Examples
3054

0 commit comments

Comments
 (0)