Skip to content

pause() should not be ignored with cypress run --headed --no-exit #20745

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

Closed
totomaze opened this issue Mar 23, 2022 · 3 comments · Fixed by #20877
Closed

pause() should not be ignored with cypress run --headed --no-exit #20745

totomaze opened this issue Mar 23, 2022 · 3 comments · Fixed by #20877
Assignees
Labels
type: regression A bug that didn't appear until a specific Cy version release v9.2.0 🐛 Issue present since 9.2.0

Comments

@totomaze
Copy link

totomaze commented Mar 23, 2022

Current behavior

With version 9.5.2 pause() is ignored even with the 2 flags --headed --no-exit.

I downgraded to 8.6.0 and this feature works fine. A regression must have occured

Desired behavior

pause() should not be ignored with cypress run --headed --no-exit

I would suggest to make it work without the --no-exit flag since this flag will block all the following tests to run even if the window is close.

Test code to reproduce

Add a cy.pause() in a test case and run it with cypress run --headed --no-exit (the pause() will be ignored)

If you run the test with cypress open it will work

Cypress Version

from 9.2.0 to 9.5.2 pause() is ignored

Other

The last version where it s working is 9.1.1, after this version using --headed --no-exit no longer pause during a test run (cypress run --headed --no-exit)

I believe it s caused by this update in 9.2.0:
Cypress will throw an error when a user attempts to update a configuration
value at run-time using either the Test Configuration or using
Cypress.config() that is a
readonly option.
Addresses #6407 and
#19001.

Is there any workaround to get the test to pause when running it by cypress run ?

Here is the original pull request that allow a test run to pause when started by cypress run:
#18358

@emilyrohrbough
Copy link
Member

@totomaze This indeed does appear to be a regression. Is this something you'd be willing to make a contribution to fix?

@emilyrohrbough emilyrohrbough added the type: regression A bug that didn't appear until a specific Cy version release label Mar 23, 2022
@totomaze
Copy link
Author

@totomaze This indeed does appear to be a regression. Is this something you'd be willing to make a contribution to fix?

If I find some free time I might try to find a solution , but for now I found a workaround that suits me and work for 9.5.2 :

if (Cypress.config('browser').isHeaded){
  window.top.__cySkipValidateConfig = true
  Cypress.config('isInteractive',true)
}

Another solution will be to allow the following to work
cypress run -s test --config isInteractive=true

If someone have the dev environment maybe try to remove the config('exit') to see if it works :
packages/driver/src/cy/commands/debugging.ts Line 50

pause (subject, options: any = {}) {
      // bail if we're in run mode, unless --headed and --no-exit flags are passed
      if (!config('isInteractive') && (!config('browser').isHeaded || config('exit'))) {
        return subject
      }

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 11, 2022

Released in 9.5.4.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.5.4, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Apr 11, 2022
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that didn't appear until a specific Cy version release v9.2.0 🐛 Issue present since 9.2.0
Projects
None yet
4 participants