cypress: `pause()` should not be ignored with `cypress run --headed --no-exit`
Current behavior:
cy.pause() is ignored when specs are run with cypress run

Notice that I have cy.pause() in the code to the left, but the test on the run hasn’t paused
Desired behavior:
I’d want the test to actually pause. Or make it really clear in the documentation that pause() is only working when you use cypress open
This is what it looks like when I use cypress open. I want the same behavior when I run with cypress run

Steps to reproduce: (app code and test code)
Add cy.pause() to any test, run it with cypress run, observe that the test is not paused.
Versions
Win 10 Electron (included with cypress) Cypress 3.2.0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 11
- Comments: 30 (11 by maintainers)
Yeah, this does seem like a valid use case though, I believe the
cy.pause()should work as normal when running with--headed --no-exitflags.My use case is that I need to debug why a test is failing only in
cypress runand notcypress open. I tried the solution offered by @Konstruktour butcypress runapparently doesn’t take that config option anymore.My workaround was to overwrite
cy.pause()when using the CLI:cypress/support/commands.js
cypress/plugins/index.js
as a workaround: set the config parameter
Cypress.config('isInteractive', true);, thenpauseworks like in the headed mode.My use-case for this is to be able to tell someone:
If I can have a single test pause at meaningful points with comments, then I can use cypress as a walkthrough of a problem. If I can specify the test path on the command line and have cypress immediately start running it, then someone who isn’t yet sold on cypress does not have to hunt around the interface for the test that I point to, but can instead just run that command and see “woah, this is animating the browser in front of me and not flakey” just after copy-pasting commands.
This turns cypress into a tool for
My use-case might be better accomplished by adding a
--specargument tocypress openwhich would cause a particular test or set of tests to run immediately upon opening. Then I could docypress open --detached --spec=cypress/integration/bugs/reproduce_bug.spec.js+1, in nrwl/nx environment, “cypress run” is the default command
Because of this issue #1669. I cannot use
cypress opento run my case. So I needcy.pause()to work oncypress run