Skip to content

Instantly share code, notes, and snippets.

@pibby
Last active August 29, 2015 13:57
Show Gist options
  • Save pibby/9421078 to your computer and use it in GitHub Desktop.
Save pibby/9421078 to your computer and use it in GitHub Desktop.

Revisions

  1. pibby revised this gist Mar 7, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions screencap-responsive-local-firefox
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    #!/usr/bin/ruby
    # Katie Harron - @pibby

    require 'watir-webdriver'

    mq = [320,480,640,768,1024,1280,1440]
  2. pibby created this gist Mar 7, 2014.
    19 changes: 19 additions & 0 deletions screencap-responsive-local-firefox
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/usr/bin/ruby
    require 'watir-webdriver'

    mq = [320,480,640,768,1024,1280,1440]

    b = Watir::Browser.new :firefox
    b.goto 'http://localhost:8000'

    mq.each do |i|
    width = i + 15
    height = 5000
    puts i

    b.window.resize_to(width, height)
    sleep 3
    b.screenshot.save "screenshots/ff-#{i}.png"
    end

    b.quit