Sha256: e9f047578499e0e67d042407ab86dc33a9042536636dbe8718d0c95ad022afdb

Contents?: true

Size: 407 Bytes

Versions: 17

Compression:

Stored size: 407 Bytes

Contents

#coding: US-ASCII
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

17 entries across 17 versions & 4 rubygems

Version Path
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/capybara-2.4.4/lib/capybara/spec/session/screenshot_spec.rb
capybara-2.6.2 lib/capybara/spec/session/screenshot_spec.rb
capybara-2.6.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-2.6.0 lib/capybara/spec/session/screenshot_spec.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/capybara-2.4.4/lib/capybara/spec/session/screenshot_spec.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/capybara-2.4.4/lib/capybara/spec/session/screenshot_spec.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/capybara-2.4.4/lib/capybara/spec/session/screenshot_spec.rb
capybara-2.5.0 lib/capybara/spec/session/screenshot_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/capybara-2.4.4/lib/capybara/spec/session/screenshot_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/capybara-2.4.4/lib/capybara/spec/session/screenshot_spec.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/capybara-2.4.4/lib/capybara/spec/session/screenshot_spec.rb
capybara-2.4.4 lib/capybara/spec/session/screenshot_spec.rb
capybara-2.4.3 lib/capybara/spec/session/screenshot_spec.rb
capybara-2.4.2 lib/capybara/spec/session/screenshot_spec.rb
capybara-2.4.1 lib/capybara/spec/session/screenshot_spec.rb
capybara-2.4.0 lib/capybara/spec/session/screenshot_spec.rb
capybara-2.3.0 lib/capybara/spec/session/screenshot_spec.rb