mattheworiordan / capybara-screenshot

Automatically save screen shots when a Capybara scenario fails
MIT License
1.02k stars 168 forks source link

Add direct screenshop option. #196

Closed ekampp closed 5 years ago

ekampp commented 7 years ago

This allows calling screenshot 'some_file' in a test to capture a screenshot, but without opening the file or saving the html.

I have added some tests, but I'm unsure on how to properly cover the rest of the suite. Please advise. Thanks.

mattheworiordan commented 7 years ago

Thanks for this contribution @ekampp. I've been incredibly busy for a while so neglected this Gem, please accept my apologies for such a slow reply.

In terms of test coverage, can you not simply add a test to one of the existing tests such as https://github.com/mattheworiordan/capybara-screenshot/blob/master/spec/rspec/rspec_spec.rb or do something like https://github.com/mattheworiordan/capybara-screenshot/blob/master/spec/unit/s3_saver_spec.rb for example. I would really like to see a test that at least confirms it results in a screenshot being saved in the correct location before being merged.