Last active
November 29, 2017 22:18
-
-
Save ckenst/47e2b92ca9548aeb10554c835c5b4c37 to your computer and use it in GitHub Desktop.
Debugging a Selenium Test using binding.pry
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 'pry' # Add to gemfile if not already there | |
# Not a functioning test | |
# Also not the greatest example | |
def run | |
setup | |
yield | |
teardown | |
end | |
run do | |
@driver.get 'http://www.kenst.com/about' | |
binding.pry # Test will pause here during run. You'll see debug info in console. Pressing enter will resume test. | |
expect(@driver.title).to eql "About – Chris Kenst's Blog" | |
@driver.save_screenshot(File.join(Dir.pwd, "headless.png")) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment