-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pause()
should not be ignored with cypress run --headed --no-exit
#4044
Comments
Hey, what is it you are trying to accomplish by adding But yes, the |
Yeah, I was running it like this: I didn't know |
Yeah, this does seem like a valid use case though, I believe the |
pause()
is ignored with cypress run
pause()
should not be ignored with cypress run --headed --no-exit
Because of this issue #1669. I cannot use |
@JohnnyChiang can you post in that issue a detailed description of your problem? |
@bkucera I ran into the same problem as #1669 (comment) did. |
+1, in nrwl/nx environment, "cypress run" is the default command |
I am in to the same problem, i am running cypress run, need to do this as i run with cli args. Do you know if this is going to be fix soon? |
I'm also having this issue. My use case is running cypress for end to end tests with a Vue-based SPA and a Django back end. I want to write my fixture and test setup code in Django (where I already have tooling) and then trigger Cypress tests. I'd like to use pause to experiment and diagnose issues. |
This comment has been minimized.
This comment has been minimized.
@jdillworth Why can't you use |
@bkucera I can now, but I had to make endpoints on my backend to load and reset fixtures. The norm in Django is for the Django CLI to drive the tests. |
@jdillworth I see, that is a more advanced use case. It would be nice to have a recipe for django (I'm assuming Django rest framework?) so other users have more guidance |
@jdillworth I obviously don't know how your frontend and backend code is organized, but you can use the cy.exec('django-admin loaddata path/to/mydata.json') |
@bkucera interesting, it'll probably be a month or so but I'll post something and refer to it here |
@amirrustam thanks for the suggestion. In my case I'm generating data sets using parameters and also need to wipe out my app-specific models at times. I think endpoints seems to fit with Cypress' thinking... keep tests as fast as possible, shave off every second. Calling an endpoint is probably faster than calling the command and incurring another python instance's startup time |
If your data seeding is very context-specific, then specialized endpoints would be more optimal. However, performance is purely dependent on your implementation. To call you endpoints you can make requests via tasks with |
the code to change this is located here: Commands.addAll({ type: "utility", prevSubject: "optional" }, {
## pause should indefinitely pause until the user
## presses a key or clicks in the UI to continue
pause: (subject, options = {}) ->
## bail if we're headless
return subject if not config("isInteractive") PRs welcome |
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, This turns cypress into a tool for
My use-case might be better accomplished by adding a |
Support for |
I need one of two possible ways to run a test containing
The reason is that I want to call the test from a script which automaticaly starts selected Cypress example. The test contains pause() to give user a chance to study example in details instead of "watching a movie" flickering in front of him for a couple of seconds |
This fits my use-case exactly. Two other things:
Django users can say an equivalent thing for I should create a separate issue for this... |
I would also like to be able to "pause" when running with Also, while cypress continues to skip the Thanks! |
as a workaround: set the config parameter |
My use case is that I need to debug why a test is failing only in |
In typescript and on the command line it complains that the 'isInteractive' option doesn't exist, but when you use plain js and put the line This looks like another bug. It would be nice if this was properly fixed since I want to introduce to my company a new way to automate PR testing where the test is agnostic of the project. |
My workaround was to overwrite cypress/support/commands.js
cypress/plugins/index.js
|
It just doesn't work.
Cypress logs:
|
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
cy.pause()
is ignored when specs are run withcypress run
Notice that I have
cy.pause()
in the code to the left, but the test on the run hasn't pausedDesired behavior:
I'd want the test to actually pause. Or make it really clear in the documentation that
pause()
is only working when you usecypress open
This is what it looks like when I use
cypress open
. I want the same behavior when I run withcypress run
Steps to reproduce: (app code and test code)
Add
cy.pause()
to any test, run it withcypress run
, observe that the test is not paused.Versions
Win 10
Electron (included with cypress)
Cypress 3.2.0
The text was updated successfully, but these errors were encountered: