-
-
Notifications
You must be signed in to change notification settings - Fork 153
Description
Current behavior
'Before' and 'After' hook names are missleading
from wiki:
"Before() and After() is similar to Cypress' beforeEach() and afterEach()"
Desired behavior
i want some code to run only once for all tests. in cypress i would do something like:
before(() => { // runs once before all tests in the block })
in preprocessor the name is confusing as it suggests running once.
it would be preferable to change 'Before' to 'BeforeEach' and make 'Before' behave in a way that it only runs once per test run
Before({ tags: "@foo" }, function () { // This hook will be executed once before all scenarios tagged with @foo. });
BeforeEach({ tags: "@foo" }, function () { // This hook will be executed before each scenario tagged with @foo. });
Test code to reproduce
Before({ tags: "@foo" }, function () { // This hook will be executed before scenarios tagged with @foo. });
Versions
- Cypress version:
- 9.7.0
- Preprocessor version:
- 4.0.1
- Node version:
*v16.15.1
Checklist
- I've read the FAQ.
- I've read Instructions for logging issues.
- I'm not using
[email protected]
(package name has changed and it is no longer the most recent version, see #689).