Expose event for when Cypress is about to exit
See original GitHub issueWe have a process that starts up when Cypress does, which we start from the Cypress plugins index.js, using NodeJS’s child_process
. The process is Wiremock, to be exact. We know we can use Cypress’ fixtures, but for now this is not an option.
We would like an event to be implemented that we can bind to so we can kill the child_process
when Cypress is about to exit.
On Windows the child_process
is killed automatically, but on Linux it needs to be manually stopped, because it keeps running even after the parent process is killed.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Using Events Emitted from Your Application during End-to ...
In this blog post I will show how to start using web app events in your end-to-end tests with minimal effort. Oh, and...
Read more >Best Practices - Cypress Documentation
One of the best parts of Cypress is its emphasis on debuggability. Unlike other testing tools - when your tests end - you...
Read more >Debugging - Cypress Documentation
What you'll learn How Cypress runs in the same event loop with your code, keeping debugging less demanding and more understandable How Cypress...
Read more >window - Cypress Documentation
This blog post explains how to use cy.window() to spy on the DOM prototype to detect when the application starts adding event listeners...
Read more >Writing a Plugin - Cypress Documentation
on is a function that you will use to register listeners on various events that Cypress exposes. Registering to listen on an event...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Even if easy to implement, there are many considerations when deciding what to put into the product beside its ease of implementation. We’ll leave this issue as a proposal and see if this issue gains more 👍 or comments in support from other users.
This would likely fall under the work slated for https://github.com/cypress-io/cypress/issues/2840
Thanks I will have a look at the module API.
But lifecycle events are always useful and it seems easy to fire an event when it’s about to exit (maybe where it’s logged)? Then if listeners are registered, wait for their promises to resolve, else just exit?