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

Godog needs Embed Screenshot #124

Open
papitodev opened this issue Apr 3, 2018 · 8 comments
Open

Godog needs Embed Screenshot #124

papitodev opened this issue Apr 3, 2018 · 8 comments

Comments

@papitodev
Copy link

I've been working with Cucumber Ruby for years.
I am testing the Godog integrated with Selenium and it was wonderful.
But I would like to be able to include Screenshots in the JSON report

Examples:
embed "screenshot.png", "image / png"

Does Godog support this?
When will Godog support this feature?

@l3pp4rd
Copy link
Member

l3pp4rd commented Apr 3, 2018

Hi, currently godog does not have errors with attachments. Probably will be added with #88 but cannot say when it will be available, I have much interest in other things at the moment. If you do need it badly, you may fork and add a small extension to it or:

  1. save screenshots somewhere on disk
  2. godog -f cucumber | embed-screenshots | html-report

Where embed-screenshots would check the directory where your screenshots are saved (named as identifier so that you know to which scenario it should be embedded) and if there are any screenshots there embed them where appropriate and produce json then finally whatever tool you are using to html report

I would still need to investigate how cucumber ruby, js manages attachments and decide how to integrate them. maybe it will be enough just for custom AttachmentErr type.

@l3pp4rd l3pp4rd added the P3 label Apr 3, 2018
@llonchj
Copy link

llonchj commented Oct 10, 2018

@papitoio have a look at https://github.com/llonchj/browsersteps

@linuxramu
Copy link

:

If you do need it badly, you may fork and add a small extension to it or:

I am intrested to know on what to FORK? Link please

@l3pp4rd
Copy link
Member

l3pp4rd commented Mar 21, 2019

@linuxramu you can create a custom error and return it in your step on failure with a screenshot attached, then the change in godog would require to edit this function and attach it correctly to the report if error instance is the one with attachment.

this is not yet implemented internally, since I do not yet know what could be an appropriate way to manage it.

@cbush06
Copy link
Contributor

cbush06 commented May 21, 2019

@papitoio I added this feature: #174

@l3pp4rd Please review and approve pull request to add this new feature to godog. I tried to keep everything as consistent as possible with how godog works. I also added documentation to your README file with an example.

@inluxc
Copy link

inluxc commented Mar 12, 2020

With the recent update, we can start thinking about implementing this issue.
It's quite important for test selenium based.
As the standard says it's not only screenshots but any type of embedded files.
In my example, I have ate leased 3 types of files.

@andrewesweet
Copy link

What’s the current thinking on how we’d like to expose this? Is there a suggested API, for example?

@Johnlon
Copy link
Member

Johnlon commented May 2, 2024

Still doesn't seem to be a way to get this working in godog - or more generally no way to add "attachments" or "embeddings" at all. Any ideas?

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

9 participants