Sha256: 1fd47a4c3cb0ad813fed1ceb76050a1b7fc90e77a32b09d96ba06d432df5ab8d

Contents?: true

Size: 436 Bytes

Versions: 97

Compression:

Stored size: 436 Bytes

Contents

# coding: US-ASCII
# frozen_string_literal: true

Capybara::SpecHelper.spec '#save_screenshot' do
  let(:image_path) { File.join(Dir.tmpdir, 'capybara-screenshot.png') }

  before do
    @session.visit '/'
  end

  it 'should generate PNG file', requires: [:screenshot] do
    path = @session.save_screenshot image_path

    magic = File.read(image_path, 4)
    expect(magic).to eq "\x89PNG"
    expect(path).to eq image_path
  end
end

Version data entries

97 entries across 83 versions & 5 rubygems

Version Path
capybara-3.11.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.11.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.10.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.10.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.9.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.8.2 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.8.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.8.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.7.2 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.7.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.7.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.6.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.5.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.5.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.4.2 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.4.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.4.0 lib/capybara/spec/session/screenshot_spec.rb