-
-
Notifications
You must be signed in to change notification settings - Fork 149
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 'BeforeAll' hook #758
Comments
You can still do this.
This doesn't exist in |
I think it does exist in cucumber-js. There are two hooks |
You're right, these aren't implemented but should be. I can't look into it now, contributions are welcome. |
Since the feature is about adding some setup before or after the run, would'nt it be better if we allow the users to add some customized callback inside the Cypress cypress-cucumber-preprocessor/lib/add-cucumber-preprocessor-plugin.ts Lines 89 to 95 in 5dc7de9
|
@lotmek, this is already possible through the API that was devised before the existence of As for the original proposal, a |
Hi, I'm interested in contributing. Can I pick this up? |
You may. I recommend starting by looking at it as it exist in |
The above-mentioned PR has been merged and released with v19.1.0. |
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
*v16.15.1
Checklist
cypress-cucumber-preprocessor@4.3.1
(package name has changed and it is no longer the most recent version, see #689).The text was updated successfully, but these errors were encountered: