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

Proposal: add new plugin events 'before:spec', 'after:spec', 'before:run', 'after:run' #2286

Closed
chrisbreiding opened this issue Aug 6, 2018 · 4 comments
Assignees
Labels
type: duplicate This issue or pull request already exists
Milestone

Comments

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Aug 6, 2018

These would only be fired in run mode.

The before:spec event should include some type of behavior where if the users returns false and throws a cancellation error, it won't run that spec and move on to the next one.

@chrisbreiding chrisbreiding added type: feature New feature that does not currently exist pkg/server This is due to an issue in the packages/server directory labels Aug 6, 2018
@chrisbreiding chrisbreiding self-assigned this Aug 6, 2018
@jennifer-shehane jennifer-shehane added the stage: proposal 💡 No work has been done of this issue label Aug 6, 2018
@chrisbreiding chrisbreiding added stage: in progress and removed stage: proposal 💡 No work has been done of this issue labels Aug 30, 2018
@chrisbreiding chrisbreiding changed the title Proposal: add new plugin events 'before:spec', 'after:spec', 'after:run' Proposal: add new plugin events 'before:spec', 'after:spec', 'before:run', 'after:run' Aug 30, 2018
@chrisbreiding chrisbreiding modified the milestones: Sprint 0.5, Sprint 1 Sep 4, 2018
@brian-mann brian-mann modified the milestones: Sprint 1, Sprint 2 Sep 10, 2018
@jennifer-shehane jennifer-shehane modified the milestones: Sprint 2, Sprint 3 Sep 17, 2018
@chrisbreiding chrisbreiding modified the milestones: Sprint 3, Sprint 4 Sep 24, 2018
@amitzur
Copy link

amitzur commented Oct 29, 2018

why would this fire only in run mode?

@chrisbreiding
Copy link
Contributor Author

That's a good question. We discussed this a bit and decided they would fire in interactive mode as well, with some caveats.

  • run:start will fire when opening a project
  • spec:start will fire when the browser opens
  • spec:end will fire when the browser closes (and may not fire at all (if, for example, you force quit Cypress)
  • run:end will fire when you close the project (and may not fire at all (if, for example, you force quit Cypress)

The *:end events will only receive results in run mode, since there's no way to aggregrate results from interactive mode.

@stephanmullerNL
Copy link

I'd love to be able to hook into the start and end of my run with a plugin. +1

@jennifer-shehane
Copy link
Member

Closing in favor of #6665

@jennifer-shehane jennifer-shehane added type: duplicate This issue or pull request already exists and removed difficulty: 2️⃣ pkg/server This is due to an issue in the packages/server directory type: feature New feature that does not currently exist labels Jun 24, 2020
@cypress-io cypress-io locked as off-topic and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants