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.32.2 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.32.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.32.0 lib/capybara/spec/session/screenshot_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/capybara-3.31.0/lib/capybara/spec/session/screenshot_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.29.0/lib/capybara/spec/session/screenshot_spec.rb
capybara-3.31.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.30.0 lib/capybara/spec/session/screenshot_spec.rb
tdiary-5.1.0 vendor/bundle/gems/capybara-3.29.0/lib/capybara/spec/session/screenshot_spec.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/spec/session/screenshot_spec.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/spec/session/screenshot_spec.rb
capybara-3.29.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.28.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.27.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.26.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.25.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.24.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.23.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.22.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.21.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-3.20.2 lib/capybara/spec/session/screenshot_spec.rb