Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HannaTarasevich opened this issue May 24, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@HannaTarasevich
Copy link
Contributor

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

@christian-bromann
Copy link
Contributor

Hey @HannaTarasevich , thanks for reporting.

Any contributions that resolves the bug are highly appreciated. Don't expect this to be picked up by active contributors as they have their own priorities. If you depend on this bug to be fixed, your contribution is required. Please take a look into our contribution guidelines or join our Discord development server and let us know if you have any questions. Cheers!

@christian-bromann christian-bromann added bug Something isn't working help wanted Extra attention is needed labels May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants