Created
July 1, 2013 01:15
-
-
Save BiggerNoise/5897770 to your computer and use it in GitHub Desktop.
Trying to demonstrate an issue that I am having when running capybara with a page that has an on document ready callback
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
require "capybara" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
puts 'You Lose' unless sess.has_content? 'Here it Is' | |
puts sess.html | |
__END__ | |
<!doctype html> | |
<html> | |
<head> | |
<script src="jquery-1.8.3.min.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<p id="target"></p> | |
<div id="data" data-sample="Here it Is"></div> | |
<script> | |
$( function() { | |
$('#target').text($('#data').data('sample')) | |
} | |
) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment