-
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
Before and beforeEach in supportFile - unexpected behavior during 'run all specs' #4703
Comments
you can also put before() and beforeeach() inside spec files... |
Sure, but I'd like to extract some logic to |
I'm so confused… If you have generic before and before each, you put it in support file, cypress will apply them to the spec you wanna run… if you have unique logic for each spec file, you put before and before each into particular spec files. I don't see anything wrong with that. And based on the screenshot you have, you fixture loading got ran for each spec. What is the issue? |
That is what I'm talking about. I want to put some generic code into |
Oh, I see the issue now… sorry I didn't realize there are two before defined by you. Sorry… please ignore whatever I said… I think you are right |
This falls under this body of work: #1586 |
Are there any estimates about finishing this? |
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. |
Current behavior:
before
andbeforeEach
executed from support file seems unlogical.As docs described,
beforeEach
runs before each test in each spec file.In this way, I expect to see
before
hook before starting each spec file. But it doesn't, it runs only once.Desired behavior:
Seems like more clear to run
before
hook before each spec file, like eachbefore
hook from spec file does.Steps to reproduce: (app code and test code)
I just pasted this piece of code into
support/index.js
Versions
Cypress: 3.3.1
MacOs: 10.14.5
Google Chrome: 75.0.3770.100
The text was updated successfully, but these errors were encountered: