Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Add HTML fallback in case screenshot taking is not supported by the current driver #45

Open
3 tasks
leymannx opened this issue Nov 13, 2018 · 2 comments
Open
3 tasks

Comments

@leymannx
Copy link

leymannx commented Nov 13, 2018

Currently screenshots are only taken in JavaScript sessions. Let's add a fallback similar to what integratedexperts/behat-screenshot does, where as fallback an HTML file gets generated using the Goutte driver.

Remaining tasks:

  • Code needs to be written
  • Tests need to be updated
  • Documentation needs to be updated
@leymannx leymannx changed the title HTML fallback in case screenshot taking is not supported by the current driver Add HTML fallback in case screenshot taking is not supported by the current driver Nov 13, 2018
@tkotosz
Copy link
Collaborator

tkotosz commented Dec 22, 2018

I was thinking about this one today and this extension takes screenshots then using the configured image driver it saves the image somewhere (local file system or any remote location).
The problem is that the image driver normally expects to get an image, e.g. https://github.com/tkotosz/behat-screenshot-image-driver-uploadpie will upload the image to upload pie. If we would introduce saving html content instead then all the image drivers which expect image would be broken.

Also someone might want to generate the html file anyway even if a screenshot created, etc. All of these would introduce a lot of additional complexity in this extension, so I think the best would be to create a separate extension for this feature.

This way both extension (this one and the new one) will have only 1 responsibility, this one takes screenshots, while the other one dumps html and maybe some additional debug info as well like request headers and stuff like that.

@leymannx
Copy link
Author

leymannx commented Dec 22, 2018

Thanks for having a look at this one.

I was hoping for some low hanging fruit. Like "(if current driver !== selenium/js) { then parse DOM and save as HTML file and skip all other following tasks that normally are done saving an image }".

One of the biggest positive side effects maybe would be that the extension generates output regardless of the driver, and therefore it may avoid a lot of confusion Behat beginners have about the "screenshot only taken when JS" issues.

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

No branches or pull requests

2 participants