-
Notifications
You must be signed in to change notification settings - Fork 156
/
hooks.js
27 lines (22 loc) · 1022 Bytes
/
hooks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { Before, After } = require('@cucumber/cucumber');
// const chalk = require('chalk');
// Before(function (scenario, callback) {
// console.log( '\n' + chalk.blue.bgYellow.bold('TESTING: ') + chalk.white.bgBlue.bold(' console.log() should not break the report'));
// this.scenario = scenario;
// callback();
// });
Before({ tags: '@testPassing' }, function (scenario, callback) {
this.attach(
'Tests INFO will print here.' +
'<br>To attach INFO to Any steps, use scenario.attach function in your step definitions as shown below.' +
'<br><br>If you pass HTML\'s to scenario.attach then reporter will format accordingly <br>' +
'<br>Simple String : scenario.attach(\'sample data\')' +
'<br>Pretty JSON : scenario.attach(JSON.stringify(json, null, 2))' +
'<br>HTML Link : scenario.attach(\'format the link with html-a tag\''
);
this.attach('some text');
callback();
});
After({ tags: '@testPassing' }, function (scenario, callback) {
callback();
});