-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Environment :
- Node.js version: 18.16.0
- NPM version: 9.5.1
- webdriver.io version: 8.3.5
- @wdio/cucumber-framework version: 8.10.1
- wdio-cucumberjs-json-reporter version: 5.1.4
Config of webdriver.io and the reporter
An example of how you configured the reporter in your webdriver.io config
reporters: ['spec','dot', [ 'cucumberjs-json', {
jsonFolder: './reports/json-output-folder',
language: 'en',
}]],
/**
*
* Runs before a Cucumber Scenario.
*/
beforeScenario: function (world, context) {
// save scenario start time
cucumberJson.attach('Start Time: ' + new Date().toISOString());
},
Describe the bug
If type is not defined in the brackets as second argument, there is not 'text/plain' in JSON report.
To Reproduce
Steps to reproduce the behavior:
- Run any test with cucumberJson.attach('Start Time: ' + new Date().toISOString());
- open JSON report - there is not "mime_type": "text/plain" type for Start Time
Expected behavior
JSON report should contain the following if type is not defined:
"embeddings":[{"data":"Scenario Start Time: 2023-05-24T07:40:20.653Z","mime_type":"text/plain"}]}
Additional context
Expected behavior is described here as well: https://github.com/webdriverio-community/wdio-cucumberjs-json-reporter
