Unable to run all the tests with --headed and --no-exit flag
See original GitHub issueCurrent behavior
Just migrated to Cypress 10.02 and followed the suggested migration recommendations.
When running all my tests with the command cypress run --e2e --headed --no-exit
only the first test runs. When running headless with cypress run --e2e
all the tests runs.
I have tried different combos with specifying a browser adding/removing --no-exit
flag but it doesnβt make any difference. Only one test runs.
I did notice that I get a message regarding WebSwapCGLLayer
but not sure itβs related. Providing it in the output below.
Desired behavior
I would like to be able to run all my tests while being able to inspect the ui. Previously there was a βrun allβ button. But since itβs removed there needs to be another way of running all the tests headful.
Test code to reproduce
Inside the folder cypress/e2e
there are four test-files all following the convention name-of-test.cy.js
.
Previous cypress.json
{ "chromeWebSecurity": false }
Current cypress.config.js
const { defineConfig } = require('cypress')
module.exports = defineConfig({
chromeWebSecurity: false,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
},
})
Output from the terminal
When running cypress run --e2e --headed --no-exit
:
> cypress run --e2e --headed --no-exit
objc[8029]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa55f21318) and /Users/me/Library/Caches/Cypress/10.0.2/Cypress.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10ef7c9c8). One of the two will be used. Which one is undefined.
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
====================================================================================================
(Run Starting)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cypress: 10.0.2 β
β Browser: Electron 100 β
β Node Version: v16.15.0 (/Users/me/.nvm/versions/node/v16.15.0/bin/node) β
β Specs: 4 found (first-test.cy.js, second-test.cy.js, third-test.cy.js, four β
β th-test.cy.js) β
β Searched: cypress/e2e/**/*.cy.{js,jsx,ts,tsx} β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Running: first-test.cy.js (1 of 4)
View things in first test
β can run first test (23334ms)
1 passing (25s)
not exiting due to options.exit being false
Cypress Version
10.0.2
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top GitHub Comments
Right, I see the problem. I made a minimal reproduction: https://github.com/lmiller1990/cypress-run-all
yarn cypress run --e2e --headed
works fine for me. Iβm surprised itβs not for you. Can you clone the repo above and runyarn cypress run --e2e --headed
? I recorded a video of it working on my machine, just to sanity check myself https://github.com/lmiller1990/cypress-run-all/blob/main/repro.mov. If you addDEBUG=cypress*
in front ofyarn cypress run...
you can get a huge log, which you could copy paste here to further help with debugging.I see the problem with
--no-exit
. The difference here (which is different to 9.x) is that we now close the browser between each spec, to clean up and do some other things. Because--no-exit
is present, this blocks the closing, thus only the first spec runs. This is obviously a problem that we need to fix.So we have two things
yarn cypress run --e2e --headed
. Although I canβt reproduce it, this is a huge problem and the #1 priority - hopefully someone can share some information that will help reproduce it, so we can patch it.--no-exit
causes first spec to hang.Please leave feedback on the removal of the run all feature over here on the discussion: https://github.com/cypress-io/cypress/discussions/21628