Skip to content
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

after:run not run when closing the test runner #18955

Open
robert-elles opened this issue Nov 17, 2021 · 7 comments
Open

after:run not run when closing the test runner #18955

robert-elles opened this issue Nov 17, 2021 · 7 comments
Labels
prevent-stale mark an issue so it is ignored by stale[bot] stage: ready for work The issue is reproducible and in scope type: bug

Comments

@robert-elles
Copy link

robert-elles commented Nov 17, 2021

Current behavior

From the after:run api documentation :
The after:run event fires after a run is finished. When running cypress via cypress open, the event will fire when closing a project.

The before:run event it triggered perfectly fine and I see the log output in the terminal. But when I close the test runner tool window nothing happens, there is no log output in the terminal. I tried different ways to close the project: by selecting close window from the menu, by pressing ctrl+c in the terminal and by closing the window using the window manager.

Desired behavior

On closing the test runner tool window after:run event is triggered

Test code to reproduce

Enable experimental flag in config file:

"experimentalInteractiveRunEvents": true

In plugins/index.js:

module.exports = (on, config) => {

     on('before:run', (details) => {
         console.log("before:run triggered")
     }

    on('after:run', (results) => {
        console.log("after:run triggered")
    })
}

Cypress Version

8.7.0 and 9.0.0

Other

No response

@BlueWinds
Copy link
Contributor

Thanks for the detailed repro steps, I've verified that it's broken as described.

Looks like after:run is supposed to be triggered from ProjectBase.close(), but this isn't getting invoked at all. I suspect this is an oversight in resetOpenProject, but I'm not super familiar with this area of code to be sure.

@jellisii
Copy link

This still seems to be true with 10.9.0

@MichelMan
Copy link

Any news regarding this issue? Still the same with v12.3.0...

badeball added a commit to badeball/cypress-cucumber-preprocessor that referenced this issue May 1, 2023
Messages are no longer lingering in the runtime, but passed along to the
backend using tasks immediately. This is a prerequisite for the
following issues:

 - 810 [1]
 - 824 [2]
 - 944 [3]

This is not to say that these will be fixed shortly or even at all, but
at least now it will be remotely possible.

Furthermore, this removes any doubt regarding whether reports work in
interactive mode. The experimental flag simply turns out to be too
broken [4-5]. Interactive mode is now detected and reports turned off.

Lastly, detecting interactive mode is a somewhat broken feature [6]. The
workaround (using `isTextTerminal`) is only available in Cypress v10 and
beyond. Thus is Cypress v9 now unsupported.

[1] #810
[2] #824
[3] #944
[4] cypress-io/cypress#18955
[5] cypress-io/cypress#26634
[6] cypress-io/cypress#20789
badeball added a commit to badeball/cypress-cucumber-preprocessor that referenced this issue May 1, 2023
Messages are no longer lingering in the runtime, but passed along to the
backend using tasks immediately. This is a prerequisite for the
following issues:

 - 810 [1]
 - 824 [2]
 - 944 [3]

This is not to say that these will be fixed shortly or even at all, but
at least now it will be remotely possible.

Furthermore, this removes any doubt regarding whether reports work in
interactive mode. The experimental flag simply turns out to be too
broken [4-5]. Interactive mode is now detected and reports turned off.

Lastly, detecting interactive mode is a somewhat broken feature [6]. The
workaround (using `isTextTerminal`) is only available in Cypress v10 and
beyond. Thus is Cypress v9 now unsupported.

[1] #810
[2] #824
[3] #944
[4] cypress-io/cypress#18955
[5] cypress-io/cypress#26634
[6] cypress-io/cypress#20789
badeball added a commit to badeball/cypress-cucumber-preprocessor that referenced this issue May 1, 2023
Messages are no longer lingering in the runtime, but passed along to the
backend using tasks immediately. This is a prerequisite for the
following issues:

 - 810 [1]
 - 824 [2]
 - 944 [3]

This is not to say that these will be fixed shortly or even at all, but
at least now it will be remotely possible.

Furthermore, this removes any doubt regarding whether reports work in
interactive mode. The experimental flag simply turns out to be too
broken [4-5]. Interactive mode is now detected and reports turned off.

Lastly, detecting interactive mode is a somewhat broken feature [6]. The
workaround (using `isTextTerminal`) is only available in Cypress v10 and
beyond. Thus is Cypress v9 now unsupported.

[1] #810
[2] #824
[3] #944
[4] cypress-io/cypress#18955
[5] cypress-io/cypress#26634
[6] cypress-io/cypress#20789
badeball added a commit to badeball/cypress-cucumber-preprocessor that referenced this issue May 1, 2023
Messages are no longer lingering in the runtime, but passed along to the
backend using tasks immediately. This is a prerequisite for the
following issues:

 - 810 [1]
 - 824 [2]
 - 944 [3]

This is not to say that these will be fixed shortly or even at all, but
at least now it will be remotely possible.

Furthermore, this removes any doubt regarding whether reports work in
interactive mode. The experimental flag simply turns out to be too
broken [4-5]. Interactive mode is now detected and reports turned off.

Lastly, detecting interactive mode is a somewhat broken feature [6]. The
workaround (using `isTextTerminal`) is only available in Cypress v10 and
beyond. Thus is Cypress v9 now unsupported.

[1] #810
[2] #824
[3] #944
[4] cypress-io/cypress#18955
[5] cypress-io/cypress#26634
[6] cypress-io/cypress#20789
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jul 13, 2023
@badeball
Copy link
Contributor

This bug is still present in v12.17.1.

@nagash77 nagash77 removed the stale no activity on this issue for a long period label Jul 13, 2023
@matthiasreinartz
Copy link

Still present in 13.5.0

@jennifer-shehane jennifer-shehane added type: bug stage: ready for work The issue is reproducible and in scope labels Dec 19, 2023
@jennifer-shehane jennifer-shehane added the prevent-stale mark an issue so it is ignored by stale[bot] label Jan 25, 2024
@liliancunha
Copy link

Any news here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prevent-stale mark an issue so it is ignored by stale[bot] stage: ready for work The issue is reproducible and in scope type: bug
Projects
None yet
Development

No branches or pull requests