Sha256: 209f9d897c0faf97482bd228dd611351ab781dd8eae7a157b4d8828c38e9aea3

Contents?: true

Size: 772 Bytes

Versions: 3

Compression:

Stored size: 772 Bytes

Contents

require 'capybara/rspec'
require 'capybara/poltergeist'
require 'active_support/all'
require 'erector'
require 'dvl/core'
require_relative '../preview/app'

Capybara.app = App
Capybara.javascript_driver = :poltergeist

def take_screenshot(path, name, res_x = 900, res_y = 150, opts = {})
  describe "taking screenshot: #{name}.png" do
    before do
      page.driver.resize(res_x, res_y)
    end

    it 'works' do
      visit path
      page.save_screenshot "screenshots/#{name}.png", opts
    end
  end
end

describe Dvl::Core do
  describe 'Screenshots', type: :feature, js: true do
    take_screenshot '/', 'all_1200', 1200, 1000, full: true
    take_screenshot '/', 'all_760', 760, 1000, full: true
    take_screenshot '/', 'all_400', 400, 1000, full: true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dvl-core-0.0.3 spec/dvl_core_spec.rb
dvl-core-0.0.2 spec/dvl_core_spec.rb
dvl-core-0.0.1 spec/dvl_core_spec.rb