Sha256: 0965cc94ff81a50d4dd0acc95ad11feaf3f9e09197cf5081d6f21554b9fcd3ae
Contents?: true
Size: 728 Bytes
Versions: 13
Compression:
Stored size: 728 Bytes
Contents
require 'capybara' module IntegrationTest include Capybara::DSL def setup super %x[rm -rf test/dummy/tmp/cache] end def teardown super Capybara.reset_sessions! Capybara.use_default_driver end def after_teardown if @passed.blank? screenshot! puts "Failed at: #{current_url}" end end def screenshot! screenshot_dir = File.expand_path('../../tmp/', File.dirname(__FILE__)) page.driver.render(File.join(screenshot_dir, "#{@__name__}.png"), :full => true) source = page.evaluate_script("document.getElementsByTagName('html')[0].outerHTML") rescue nil File.open(File.join(screenshot_dir, "#{@__name__}.html"), 'w') { |f| f.write(source) } if source end end
Version data entries
13 entries across 13 versions & 1 rubygems