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';
|
|
|
|
|
2020-06-25 15:18:56 +00:00
|
|
|
const { After, Before } = require( 'cucumber' );
|
2018-04-10 21:19:08 +00:00
|
|
|
|
|
|
|
Before( function () {
|
|
|
|
// This hook will be executed before ALL scenarios
|
|
|
|
} );
|
|
|
|
|
|
|
|
After( function () {
|
|
|
|
// This hook will be executed after ALL scenarios
|
|
|
|
} );
|
|
|
|
|
|
|
|
Before( { tags: '@foo' }, function () {
|
|
|
|
// This hook will be executed before scenarios tagged with @foo
|
|
|
|
} );
|