-
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
after:run isn't triggered when closing the project after cypress open
#17532
Comments
@TheDutchCoder How are you closing the project via |
I just close the window. I don't think there's another way? |
I have the same problem. after:run event is not run when you are using the test runner tool. When you are finished running tests you will close the tool window. At that point I expect cypress to trigger the after:run event. |
@jennifer-shehane I think the information has been provided |
This links to issue #18955 |
Is there a reason this issue still is in this state? It is still a real problem, as our DB/user seeds don't get cleaned up currently because of it, making writing tests incredibly hard. |
I guess this is where this functionality is triggered: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/project-base.ts#L343 Since none of this is try/catched, I think something throws and it never hits the hook at the end? It's probably a good idea to do a try/catch/finally with the hook running in the finally clause? |
same issue here! |
Did anybody find a workaround for this until the issue is addressed and fixed? |
Any news regarding this issue? |
Same issue here. Any workaround ? |
Setting experimentalInteractiveRunEvents flag to true is also not triggering the after:run. Tried closing the browser but no luck with the same. after:spec works fine. There is issue with after:run IMO. |
Ran into this as well. It is causing issues with data cleanup. |
Same as everyone else, want to tear some data down post-run but can't :/ If anyone has a workaround, please post it up 🙏 |
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. |
This issue has been closed due to inactivity. |
Did anybody find a workaround? This bug still seems to exist even in the latest Cypress version |
same issue here with the latest Cypress version |
Duplicate of #18955 |
Current behavior
It looks like
after:run
never triggers.I'm not sure how it's supposed to function, the docs say it should trigger after closing the project (after
cypress open
), but it doesn't do that.Maybe these docs are incomplete? It also looks like there's at least a typo here: "You can return a promise from the after:run event handler and it will be awaited before Cypress proceeds running your specs." (I'm sure that means to say after?)
Desired behavior
This trigger to be called.
Test code to reproduce
See my above piece of code.
Cypress Version
8.0.0
Other
No response
The text was updated successfully, but these errors were encountered: