File tree Expand file tree Collapse file tree 8 files changed +516
-11
lines changed
Expand file tree Collapse file tree 8 files changed +516
-11
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ publish = "build"
7676[[plugins]]
7777# local Cypress plugin will test our site after it is built
7878package = "netlify-plugin-cypress"
79- [plugins.config ]
79+ [plugins.inputs ]
8080 record = true
8181```
8282
@@ -102,7 +102,7 @@ publish = "build"
102102[[plugins ]]
103103# local Cypress plugin will test our site after it is built
104104package = " netlify-plugin-cypress"
105- [plugins .config ]
105+ [plugins .inputs ]
106106 spec = " cypress/integration/smoke*.js"
107107```
108108
Original file line number Diff line number Diff line change 11{
22 "supportFile" : false ,
33 "pluginsFile" : false ,
4- "fixturesFolder" : false
4+ "fixturesFolder" : false ,
5+ "baseUrl" : " http://localhost:5000"
56}
Original file line number Diff line number Diff line change 11/// <reference types="cypress" />
22it ( 'loads page' , ( ) => {
3- if ( Cypress . config ( 'baseUrl' ) ) {
4- cy . visit ( '/' )
5- } else {
6- cy . visit ( 'public/index.html' )
7- }
3+ cy . visit ( '/' )
84 cy . contains ( 'Placeholder' ) . should ( 'be.visible' )
95} )
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ module.exports = function cypressPlugin (pluginConfig) {
9393 onInit,
9494 postBuild : async ( arg ) => {
9595 debugVerbose ( 'postBuild arg %o' , arg )
96+ debug ( 'cypress plugin postBuild inputs %o' , arg . inputs )
9697
9798 const fullPublishFolder = arg . netlifyConfig . build . publish
9899 debug ( 'folder to publish is "%s"' , fullPublishFolder )
Original file line number Diff line number Diff line change 33 - name : record
44 default : false
55 - 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"
1111[[plugins ]]
1212 # local Cypress plugin will test our site after it is built
1313 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