| 1 | /** |
| 2 | * Hooks |
| 3 | * |
| 4 | * Hooks are used for setup and teardown of the environment before and after each scenario. |
| 5 | * It's preferable to use tags to invoke hooks rather than using the generic 'Before' and 'After' |
| 6 | * events, which execute before and after all scenario. |
| 7 | * https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/hooks.md |
| 8 | */ |
| 9 | |
| 10 | 'use strict'; |
| 11 | |
| 12 | const { After, Before } = require( '@cucumber/cucumber' ); |
| 13 | |
| 14 | Before( () => { |
| 15 | // This hook will be executed before ALL scenarios |
| 16 | } ); |
| 17 | |
| 18 | After( () => { |
| 19 | // This hook will be executed after ALL scenarios |
| 20 | } ); |
| 21 | |
| 22 | Before( { tags: '@foo' }, () => { |
| 23 | // This hook will be executed before scenarios tagged with @foo |
| 24 | } ); |