-
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
Add new plugin events 'before:spec', 'after:spec', 'before:run', 'after:run' #6665
Comments
Is there a way for a plugin to detect if it's running in |
Hi @chrisbreiding, please don't forget about parallel run. I'll expect that run:start and run:end will be called once per run, not once on each parallel machine - I have explained my issue in #9196. Thank you for working on it :) |
Released in You can now listen to The use of the 'before:spec', 'after:spec', 'before:run', 'after:run' are not triggered in interactive mode currently. If you have a use case for needing these to run during This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Add four new events that fire in the plugins file:
before:run
: Fires before the run starts, with details about the run.before:spec
: Fires before a spec file is run, with details about the spec file.after:spec
: Fires after a spec file and its tests run, with details about the spec file and its test results.after:run
: Fires after the run finishes, with the results of the run.In
interactive
mode, the behavior is slightly different, since there isn't a discrete 'run' and specs can be re-run at will:before:run
fires when opening a project.before:spec
fires when the browser opens.after:spec
fires when the browser closes (and may not fire at all (if, for example, you force quit Cypress).after:run
fires when you close the project (and may not fire at all (if, for example, you force quit Cypress).The
after:*
events will only receive results inrun
mode, since there's no way to aggregate results frominteractive
mode.The text was updated successfully, but these errors were encountered: