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

Be able to add text to the JSON report #216

Closed
Stephane99 opened this issue Apr 5, 2022 · 1 comment
Closed

Be able to add text to the JSON report #216

Stephane99 opened this issue Apr 5, 2022 · 1 comment

Comments

@Stephane99
Copy link

Hi,

How can I add more details in the report using world.attach()?

When a step is in error, I get the screenshot in the json file, and in the Html report (generated with Cucumber HTML Reporter).

Sometimes the step is in error when comparing an array of values with expect().
In this case I would like to get the results of the expect() in the report.

I tried to add text to JSON file with world.attach() in step body but no success.
How to implement world.attach() to add more text?

Example step definition:

StepDefinitionGeneric givenFooBar() =>
    given<FlutterWorld>(RegExp(r'Foo bar$'), (context) async => context.world.attach('More details', 'text/plain'));

Note: the same question has been partially processed in this post.
#26 (comment)

Thanks for your help.

jonsamwell added a commit that referenced this issue Jul 1, 2022
…on Android (thanks to @youssef-t for the solution)

  - Fix #216 - ensure step exceptions and `expect` failure results are added as errors to the json report
  - Scenarios can now have descriptions which also appear in the json reporter output
@jonsamwell
Copy link
Owner

I think this is now doing what you want. The exceptions or expect failure reasons are now added to the json report. Please get the latest rc version 3.0.0-rc.16

image

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

No branches or pull requests

2 participants