event.all.before and event.all.after not working
What are you trying to achieve?
Trying to use the event.all hooks. In the same file I have the event.test hooks which are working successfully.
What do you get instead?
event.all hooks are not called at all. I only have a console.log in them right now and they are not called.
Provide console output if related. Use
--verbosemode for more details.
# paste output here
Provide test source code if related
event.dispatcher.on(event.all.before, function () { console.log('--- I am before all tests --'); });
// paste test
Details
- CodeceptJS version: v0.6.3-pre
- NodeJS Version: v6.10.3
- Operating System: MacOS Sierra
- Protractor || WebDriverIO || Nightmare version (if related)
- Configuration file:
# paste suite config here
Hi , I followed the link http://codecept.io/hooks to create a file that has below code `const event = require('codeceptjs').event;
module.exports = function() {
event.dispatcher.on(event.test.before, function (test) {
console.log('--- I am before test --');
}); }`
and added this file in hooks in codecept.json config file.
After running the test case it doesn't show any error and neither event is triggered. I tried with both before and after and neither works.
I added console.log for event.dispatcher and it shows events that I add, but they doesn't trigger. I have a requirement where I want to close other tabs before or after test event.
Do I need to include any files for this?
@dwaned Can you please help on this, as these events work for you.
@APshenkin : Please look into this
I don't see where these events are emitted. Maybe @DavertMik can help us with these events
Fixed in v1.1.6 which was release today.
These events now exist (again)