Sha256: fd6caff67b9dfb0c363e52cfc28415183ea8a261af2c2773619f25ed363305d7

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

require File.expand_path("watirspec/spec_helper", File.dirname(__FILE__))

describe Watir::Screenshot do
  describe '#png' do
    it 'gets png representation of screenshot from WebDriver' do
      browser.driver.should_receive(:screenshot_as).with(:png)
      browser.screenshot.png
    end
  end

  describe '#base64' do
    it 'gets base64 representation of screenshot from WebDriver' do
      browser.driver.should_receive(:screenshot_as).with(:base64)
      browser.screenshot.base64
    end
  end

  describe '#save' do
    it 'saves screenshot to given file' do
      path = "#{Dir.tmpdir}/test.png"
      browser.driver.should_receive(:save_screenshot).with(path)
      browser.screenshot.save(path)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-webdriver-0.6.1 spec/screenshot_spec.rb
watir-webdriver-0.6.0 spec/screenshot_spec.rb