mattheworiordan / capybara-screenshot

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

Screenshot uploaded to S3 using cucumber reporting local file paths #244

Open garytaylor opened 6 years ago

garytaylor commented 6 years ago

I have looked into this and have made the following "Monkey Patch" in my code. It appears that the S3 saver does not have the output_screenshot_path method defined so it calls the method on the non S3 saver and gets it wrong.

Here is my code

module Capybara
  module Screenshot
    class S3Saver
      def output_screenshot_path
        output "HTML screenshot: #{html_path}" if html_saved?
        output "Image screenshot: #{screenshot_path}" if screenshot_saved?
      end
    end
  end
end

which works a treat :-) but unsure if it will have any impact on the rspec output or any other area where it shouldnt

mattheworiordan commented 5 years ago

Thanks for reporting this @garytaylor. Fancy rolling that patch up into a PR?