-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Public API for start/end of all tests run #818
Comments
If you want to do things in the browser you can have root level For plugin related events you have In run mode |
I essentially wanted to be sure my code runs before any test-related code, but I can go with your suggestion to use root level I'd argue that in interactive mode there is an end, and that is the finish point of all the tests that currently run. It's true that this is fluid when open during development. My issue now is that in order to use root level |
I'm reopening this since root level There is a need to have a way to run a hook one time at the beginning and one time at the end of the whole run of all the files |
@amitzur Yes, this behavior did change in the 3.0 release - that Perhaps our Module API would suit your needs better. You can run any code before the |
I cannot use the module API since we run Cypress in a straight forward way and I wouldn't want to complicate that. module.exports = (on, config) => {
on('run:start', () => {...});
on('run:end', () => {...});
} By running |
Thanks, that's great to know! |
@amitzur No, those would not be available in interactive mode. The run technically never 'ends' when in interactive mode since the browser stays open. |
Is there any update on this issue? I could really use those events right about now.. (all other solutions do not work / not relevant to my needs) |
@gilgold This issue is about documentation, not the Cypress product itself. See this issue for any actual events feature: cypress-io/cypress#2840 I'm going to close this documentation issue - as the behavior of |
Not sure this is a documentation issue, but the feature does exist in Cypress.
There's a need for listening to an event that fires when tests start running. I see 3 cases where this can happen when running
cypress open
:When running
cypress run
this should happen only once, of course.From inspecting the events that Cypress emits, I see
run:start
andrun:end
answer exactly this need. So the question is, can these be used as a public API for this hook? If so, I was right to think it's a documentation issue.The text was updated successfully, but these errors were encountered: