2018-04-10 21:19:08 +00:00
|
|
|
/**
|
|
|
|
* Hooks
|
|
|
|
*
|
|
|
|
* Hooks are used for setup and teardown of the environment before and after each scenario.
|
|
|
|
* It's preferable to use tags to invoke hooks rather than using the generic 'Before' and 'After'
|
|
|
|
* events, which execute before and after all scenario.
|
|
|
|
* https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/hooks.md
|
|
|
|
*/
|
|
|
|
|
2020-06-02 21:21:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2021-11-09 14:40:14 +00:00
|
|
|
const { After, Before } = require( '@cucumber/cucumber' );
|
2018-04-10 21:19:08 +00:00
|
|
|
|
2024-07-27 05:52:33 +00:00
|
|
|
Before( () => {
|
2018-04-10 21:19:08 +00:00
|
|
|
// This hook will be executed before ALL scenarios
|
|
|
|
} );
|
|
|
|
|
2024-07-27 05:52:33 +00:00
|
|
|
After( () => {
|
2018-04-10 21:19:08 +00:00
|
|
|
// This hook will be executed after ALL scenarios
|
|
|
|
} );
|
|
|
|
|
2024-07-27 05:52:33 +00:00
|
|
|
Before( { tags: '@foo' }, () => {
|
2018-04-10 21:19:08 +00:00
|
|
|
// This hook will be executed before scenarios tagged with @foo
|
|
|
|
} );
|