File tree 8 files changed +516
-11
lines changed
8 files changed +516
-11
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ publish = "build"
76
76
[[plugins]]
77
77
# local Cypress plugin will test our site after it is built
78
78
package = "netlify-plugin-cypress"
79
- [plugins.config ]
79
+ [plugins.inputs ]
80
80
record = true
81
81
```
82
82
@@ -102,7 +102,7 @@ publish = "build"
102
102
[[plugins ]]
103
103
# local Cypress plugin will test our site after it is built
104
104
package = " netlify-plugin-cypress"
105
- [plugins .config ]
105
+ [plugins .inputs ]
106
106
spec = " cypress/integration/smoke*.js"
107
107
```
108
108
Original file line number Diff line number Diff line change 1
1
{
2
2
"supportFile" : false ,
3
3
"pluginsFile" : false ,
4
- "fixturesFolder" : false
4
+ "fixturesFolder" : false ,
5
+ "baseUrl" : " http://localhost:5000"
5
6
}
Original file line number Diff line number Diff line change 1
1
/// <reference types="cypress" />
2
2
it ( 'loads page' , ( ) => {
3
- if ( Cypress . config ( 'baseUrl' ) ) {
4
- cy . visit ( '/' )
5
- } else {
6
- cy . visit ( 'public/index.html' )
7
- }
3
+ cy . visit ( '/' )
8
4
cy . contains ( 'Placeholder' ) . should ( 'be.visible' )
9
5
} )
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ module.exports = function cypressPlugin (pluginConfig) {
93
93
onInit,
94
94
postBuild : async ( arg ) => {
95
95
debugVerbose ( 'postBuild arg %o' , arg )
96
+ debug ( 'cypress plugin postBuild inputs %o' , arg . inputs )
96
97
97
98
const fullPublishFolder = arg . netlifyConfig . build . publish
98
99
debug ( 'folder to publish is "%s"' , fullPublishFolder )
Original file line number Diff line number Diff line change 3
3
- name : record
4
4
default : false
5
5
- name : spec
6
+ # tells the plugin how to start the server using custom command
7
+ # and waiting for an url
8
+ - name : preBuild
Original file line number Diff line number Diff line change @@ -11,3 +11,8 @@ publish = "public"
11
11
[[plugins ]]
12
12
# local Cypress plugin will test our site after it is built
13
13
package = " ."
14
+ [plugins .inputs ]
15
+ spec = ' cypress/integration/spec.js'
16
+ [plugins .inputs .preBuild ]
17
+ start = ' npm start'
18
+ wait-on = ' http://localhost:5000'
You can’t perform that action at this time.
0 commit comments