@@ -253,6 +253,42 @@ describe('Cypress in Cypress', { viewportWidth: 1500, defaultCommandTimeout: 100
253253 cy . findByTestId ( 'reporter-panel' ) . should ( 'not.be.visible' )
254254 cy . findByTestId ( 'sidebar' ) . should ( 'be.visible' )
255255 } )
256+
257+ it ( `checks that specs load when devServer configuration is not set in open mode for ${ testingType } ` , ( ) => {
258+ cy . scaffoldProject ( 'cypress-in-cypress' )
259+ cy . findBrowsers ( )
260+ cy . openProject ( 'cypress-in-cypress' )
261+ cy . startAppServer ( )
262+ cy . visitApp ( )
263+ cy . contains ( 'dom-content.spec' ) . should ( 'exist' )
264+ cy . withCtx ( async ( ctx , o ) => {
265+ ctx . coreData . app . browserStatus = 'open'
266+
267+ let config = await ctx . actions . file . readFileInProject ( 'cypress.config.js' )
268+
269+ let oldFramework = `framework: 'react',`
270+ let oldBundler = `bundler: 'webpack',`
271+ let oldWebPackConfig = `webpackConfig: require('./webpack.config.js'),`
272+
273+ config = config . replace ( oldFramework , `` ) . replace ( oldBundler , `` ) . replace ( oldWebPackConfig , `` ) . replace ( `devServer: {` , `` ) . replace ( / } , / i, `` )
274+
275+ await ctx . actions . file . writeFileInProject ( 'cypress.config.js' , config )
276+
277+ o . sinon . stub ( ctx . actions . browser , 'closeBrowser' )
278+ o . sinon . stub ( ctx . actions . browser , 'relaunchBrowser' )
279+ } )
280+
281+ cy . get ( '[data-cy="loading-spinner"]' ) . should ( 'be.visible' )
282+ cy . get ( '[data-cy="loading-spinner"]' ) . should ( 'not.exist' )
283+
284+ // We navigate to another page to ensure the specs page re-renders with the updated changes in cypress config
285+ // so we can assert on an up to date specs page when we navigate back to it.
286+
287+ cy . get ( '[href="#/runs"]' ) . click ( )
288+ cy . location ( 'hash' ) . should ( 'eq' , '#/runs' )
289+ cy . get ( '[href="#/specs"' ) . click ( )
290+ cy . contains ( 'accounts_list.spec' ) . should ( 'be.visible' )
291+ } )
256292 } )
257293
258294 it ( 'restarts browser if there is a change on the config file affecting the browser' , ( ) => {
@@ -265,6 +301,7 @@ describe('Cypress in Cypress', { viewportWidth: 1500, defaultCommandTimeout: 100
265301 let config = await ctx . actions . file . readFileInProject ( 'cypress.config.js' )
266302
267303 config = config . replace ( `e2e: {` , `e2e: {\n chromeWebSecurity: false,\n` )
304+
268305 await ctx . actions . file . writeFileInProject ( 'cypress.config.js' , config )
269306
270307 o . sinon . stub ( ctx . actions . browser , 'closeBrowser' )
0 commit comments