Sha256: 20656f1cfc9b7325a964b756805e8ee68c7b9f8f5d66d905c5ea2ade65fb4ead

Contents?: true

Size: 479 Bytes

Versions: 7

Compression:

Stored size: 479 Bytes

Contents

module Webdrone
  class Browser
    def shot
      @shot ||= Shot.new self
    end
  end

  class Shot
    attr_accessor :a0

    def initialize(a0)
      @a0 = a0
    end

    def screen(name)
      @counter = (@counter || 0) + 1
      filename = sprintf "screenshot-%04d-%s.png", @counter, name
      filename = File.join(@a0.conf.outdir, filename)
      @a0.driver.save_screenshot filename
    rescue => exception
      Webdrone.report_error(@a0, exception)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
webdrone-1.2.2 lib/webdrone/shot.rb
webdrone-1.2.0 lib/webdrone/shot.rb
webdrone-1.1.4 lib/webdrone/shot.rb
webdrone-1.1.2 lib/webdrone/shot.rb
webdrone-1.1.0 lib/webdrone/shot.rb
webdrone-1.0.8 lib/webdrone/shot.rb
webdrone-1.0.6 lib/webdrone/shot.rb