Created
May 13, 2014 21:26
-
-
Save jurgenwerk/13f2b9c42dd1c70e3828 to your computer and use it in GitHub Desktop.
Taking Screenshots with Capybara and Webkit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara' | |
require 'capybara/dsl' | |
Capybara.current_driver = :webkit | |
module Screenshot | |
class Test | |
include Capybara::DSL | |
def take_screenshot(url) | |
visit(url) | |
page.save_screenshot("screenshot.png") | |
end | |
end | |
end | |
Screenshot::Test.new.take_screenshot("http://pornhub.com") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
don't forget capybara and capybara-webkit gems