Skip to content

cucumberJson.attach('just a string') does not add 'text/plain' type automatically to JSON report #161

@HannaTarasevich

Description

@HannaTarasevich

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:

  1. Run any test with cucumberJson.attach('Start Time: ' + new Date().toISOString());
  2. 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
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions