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

Cucumber v10+ attaches text/plain and application/json in base64 encoded format #438

Closed
HannaTarasevich opened this issue Feb 6, 2024 · 0 comments · Fixed by #439
Closed

Comments

@HannaTarasevich
Copy link
Contributor

Environment (please complete the following information):

  • Node.js version: 20.11.0
  • NPM version: 10.2.5
  • webdriver.io version: latest
  • @wdio/cucumber-framework version: latest
  • wdio-cucumberjs-json-reporter version: latest

Config of webdriver.io and the reporter
reporters: ['spec','dot', [ 'cucumberjs-json', {
jsonFolder: './reports/json-output-folder',
language: 'en',
}]],

Describe the bug
All text/plain and application/json attachments are encoded in a base64 string format starting from @cucumber/cucumber v10 (cucumber/cucumber-js#2260). This means that the reporters, such as multiple-cucumber-html-reporter (https:/WasiqB/multiple-cucumber-html-reporter/releases/tag/v3.6.1), which use generated JSON files for creating reports, are trying to decode all such attachments. On the other hand, WDIO JSON reporter generates text/plain and application/json attachments as plain text. This means that attachments in text/plain and application/json formats are decoded from plain text.

To Reproduce

  1. clone https:/HannaTarasevich/multiple-reporter-issue
  2. npm install
  3. npm run wdio
  4. check generated json files (reports > json)
  5. open reports > report > index.html and check attached data to the scenario's step
    image

Expected behavior

The suggestion is to unify the @cucumber/cucumber JSON reporting approach with wdio-cucumberjs-json-reporter, as it was before cucumber-js v10, and encode text/plain and application/json to base64 string.

Additional context
It could be a breaking change for the cases when generated json reports are using with the reporters that are not updated according to the latest cucumber-js changes or when the generated json files are the using for the custom reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant