Feature/issue 234 add scenario attach method #329
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Fix Embedding made screenshot into cucumber json report #234, add scenario.attach method
Added scenario.attach method, so that you can add comments and/or screenshots to the cucumber-report.json file, and then you can convert the .json file to HTML report file
Referred to this https://github.com/gkushang/cucumber-html-reporter/blob/4ed7e774f93c54ecd71a051d414a6d30305694ec/lib/reporter.js , which will convert step.embeddings to
Show Info+
An example usage:
update your conftest.py by implementing the hook: pytest_bdd_after_scenario
https://gist.github.com/kenhosr/3cb60efce5481d25967479e67f7edb76
run your test using: pytest --cucumber-json=cucumber_report.json
convert the .json to .html by following instructions here:
https://github.com/gkushang/cucumber-html-reporter
Sample Report: