Post screenshots to S3 #632

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@geoffharcourt

When screenshots are taken in CI environments, the files are saved to
temporary directories and are not accessible. This commit allows the
posting of screenshots to an S3 bucket so that they can be accessed
after CI builds.

Posting to S3 will happen automatically for screenshots if the
environment variable CAPYBARA_WEBKIT_S3_SCREENSHOTS_BUCKET is set.

Post screenshots to S3.
When screenshots are taken in CI environments, the files are saved to
temporary directories and are not accessible. This commit allows the
posting of screenshots to an S3 bucket so that they can be accessed
after CI builds.

Posting to S3 will happen automatically for screenshots if the
environment variable `CAPYBARA_WEBKIT_S3_SCREENSHOTS_BUCKET` is set.
@@ -164,6 +165,32 @@ def save_screenshot(path, options={})
options[:height] ||= 10
browser.render path, options[:width], options[:height]
+
+ if s3_bucket_name

This comment has been minimized.

Show comment Hide comment
@jferris

jferris Apr 28, 2014

Owner

Thoughts on extracting this S3 logic to a new class? There's a decent amount of stuff in Driver already.

@jferris

jferris Apr 28, 2014

Owner

Thoughts on extracting this S3 logic to a new class? There's a decent amount of stuff in Driver already.

This comment has been minimized.

Show comment Hide comment
@geoffharcourt

geoffharcourt Apr 28, 2014

I think that's a great idea. I've also been able to use this on my local, but still can't get it to work on Travis, so I don't think it's ready for a merge (sorry about that).

@geoffharcourt

geoffharcourt Apr 28, 2014

I think that's a great idea. I've also been able to use this on my local, but still can't get it to work on Travis, so I don't think it's ready for a merge (sorry about that).

@mhoran

This comment has been minimized.

Show comment Hide comment
@mhoran

mhoran Jul 1, 2014

Collaborator

@geoffharcourt, are you still interested in this feature? You said there were some issues you needed to iron out, let me know if you need any help of if you've abandoned your efforts.

Collaborator

mhoran commented Jul 1, 2014

@geoffharcourt, are you still interested in this feature? You said there were some issues you needed to iron out, let me know if you need any help of if you've abandoned your efforts.

@geoffharcourt

This comment has been minimized.

Show comment Hide comment
@geoffharcourt

geoffharcourt Jul 8, 2014

Hey @mhoran, still very much interested in this feature. I discovered after my initial PR posting that there were some problems with my implementation that I haven't quite resolved on my end. I'd appreciate it if you could keep this open for a couple more weeks while I try to resolve the problems and (I also hope) to implement @jferris' recommendation.

Hey @mhoran, still very much interested in this feature. I discovered after my initial PR posting that there were some problems with my implementation that I haven't quite resolved on my end. I'd appreciate it if you could keep this open for a couple more weeks while I try to resolve the problems and (I also hope) to implement @jferris' recommendation.

@jferris

This comment has been minimized.

Show comment Hide comment
@jferris

jferris Apr 10, 2015

Owner

I'm going to close this, because it's been open for a long time without updates.

Because Capybara itself actually has the ability to save screenshots, it would be cool to see something like this make it's way there.

My suggestion would be to submit a pull request to Capybara to make it possible to implement as a plugin, since Capybara probably would prefer not to add the AWS dependency. For example, you could add a hook which gets called when a screenshot is saved.

Owner

jferris commented Apr 10, 2015

I'm going to close this, because it's been open for a long time without updates.

Because Capybara itself actually has the ability to save screenshots, it would be cool to see something like this make it's way there.

My suggestion would be to submit a pull request to Capybara to make it possible to implement as a plugin, since Capybara probably would prefer not to add the AWS dependency. For example, you could add a hook which gets called when a screenshot is saved.

@jferris jferris closed this Apr 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment