Skip to content

Instantly share code, notes, and snippets.

@alexgb
Last active December 13, 2015 17:09
Show Gist options
  • Save alexgb/4945732 to your computer and use it in GitHub Desktop.
Save alexgb/4945732 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'capybara-webkit'
counter = 0
app = proc do |env|
counter += 1
[200, { 'Content-Type' => 'text/html' }, [counter.to_s]]
end
session = Capybara::Session.new(:webkit, app)
loop do
sleep 2
session.visit('/')
if session.find('body').text == counter.to_s
print '.'
else
puts "\n#{session.find('body').text} != #{counter}"
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment