-
-
Notifications
You must be signed in to change notification settings - Fork 753
Closed
Labels
Description
What are you trying to achieve?
wire up bdd test hooks like const { Before, After, BeforeAll, AfterAll } = require('@cucumber/cucumber');
What do you get instead?
hooks dont get triggered
Provide test source code if related
testHooks.js content:
const { Before, After, BeforeAll, AfterAll } = require('@cucumber/cucumber');
BeforeAll(() => {
console.log('Global setup before all tests');
});
AfterAll(() => {
console.log('Global teardown after all tests');
});
Before(() => {
console.log('Running setup before each test');
});
After(() => {
console.log('Running cleanup after each test');
});Details
- CodeceptJS version: 3.6.7
- NodeJS Version: v20.11.0
- Operating System: macOS 15.0.01
- puppeteer || webdriverio || testcafe version (if related)
- Configuration file:
codecept.conf.js
gherkin: {
hooks: './codeceptjs/testHooks.js',
features: '../features/**/*.feature',
steps: '../src/steps/**/*_steps.js',
},
→ testHooks.js not even called, and lifecycle methods not triggeredquestion: how to hook up bdd hooks? - in this case I needed a BeforeAll hook as a global hook
Thanks for the guidance in advance
Best Regards
Attila