pytest-bdd
pytest-bdd copied to clipboard
Embedding made screenshot into cucumber json report
Could you implement embedding possibility of made screenshot into cucumber json report when scenario step failed?
+1
@andreypetrenko82 this is already possible if you use pytest-splinter: https://github.com/pytest-dev/pytest-splinter/#automatic-screenshots-on-test-failure
splinter only outputs them into a directory. in order to view the screens as part of the cucumber report they need to be embedded.
did you check the mentioned jenkins plugin? https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Attachments+Plugin it attaches screenshots to exact test, not just to some folder
i am not sure why this plugin is relevant ? May be there are work arounds for some use cases where this is useful.
However, pytest bdd is missing a feature that other cucumber implementations have, embeddeding screenshots in the cucumber json:
https://relishapp.com/cucumber/cucumber/docs/formatters/json-output-formatter#embedding-screenshot
@jeduden sorry I didn't know about cucumber supports screenshots then it has to be implemented as a hook.
hey @bubenkoff , can you please provide some more details as to how to implement it as a hook? I want to implement it but want to make sure I am on the right path.
looked at https://github.com/pytest-dev/pytest-bdd/blob/master/pytest_bdd/cucumber_json.py, maybe no need in the hooks indeed, just use the screenshot paths and add to the json
what if we want to add some comments into the test report, in addition to screenshots?
those can be added to the assertion message
On Wed, Oct 9, 2019 at 5:16 PM kenhosr [email protected] wrote:
what if we want to add some comments into the test report, in addition to screenshots?
https://user-images.githubusercontent.com/10588269/65049617-0a8c3b80-d934-11e9-9255-e2b1049f3071.png
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pytest-dev/pytest-bdd/issues/234?email_source=notifications&email_token=AADIJAD5W5RW3PJCRV5HTT3QNXYVZA5CNFSM4ENUBDN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAYHY4Q#issuecomment-540048498, or mute the thread https://github.com/notifications/unsubscribe-auth/AADIJAC5YJMITSDIWHXPKQTQNXYVZANCNFSM4ENUBDNQ .
which hook(s) would you suggest if I do need this embedded message rather than assertion message?
Has there been any movement on implementation on this?
@bubenkoff You mentioned this could be implemented as a hook, how would someone go about doing that?