Created
August 15, 2014 18:36
-
-
Save pedantix/47138869f93436de8dbf to your computer and use it in GitHub Desktop.
This file contains 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
def show_me_a_screenshot | |
if Capybara.current_driver == :webkit | |
name = "screen-shot-#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.png" | |
tmp_dir = File.join(Rails.root, 'tmp') | |
FileUtils.mkdir_p tmp_dir | |
file_name = File.join(tmp_dir, name) | |
page.driver.save_screenshot file_name | |
Launchy.open file_name | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment