Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
11 lines (11 sloc) 423 Bytes
require 'fileutils'
module SaveScreenshots
def screenshot!(name)
return unless [:selenium, :webkit, :cuprite].include?(Capybara.current_driver)
dir = File.expand_path('../screenshots', File.dirname(__FILE__))
name = "#{name}.png" unless name =~ /\.png$/
FileUtils.mkpath(dir) unless File.directory?(dir)
puts "saving screenshot: #{name}"
save_screenshot File.join(dir, name), full: true
end
end
You can’t perform that action at this time.