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

Version Path
bootstrap-sass-3.1.1.1 test/support/integration_test.rb
bootstrap-sass-3.1.1.0 test/support/integration_test.rb
bootstrap-sass-3.1.0.2 test/support/integration_test.rb
bootstrap-sass-3.1.0.1 test/support/integration_test.rb
bootstrap-sass-3.1.0.0 test/support/integration_test.rb
bootstrap-sass-3.0.3.0 test/support/integration_test.rb
bootstrap-sass-3.0.2.1 test/support/integration_test.rb
bootstrap-sass-3.0.2.0 test/support/integration_test.rb
bootstrap-sass-3.0.1.0 test/support/integration_test.rb
bootstrap-sass-3.0.1.0.rc test/support/integration_test.rb
bootstrap-sass-3.0.0.0 test/support/integration_test.rb
bootstrap-sass-3.0.0.0.rc2 test/support/integration_test.rb
bootstrap-sass-3.0.0.0.rc test/support/integration_test.rb