Created
November 28, 2016 19:11
-
-
Save twalpole/4775247a2ed6389a58a39e67f47dee84 to your computer and use it in GitHub Desktop.
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/poltergeist" | |
# require "selenium-webdriver" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
# sess = Capybara::Session.new(:selenium, app) | |
sess = Capybara::Session.new(:poltergeist, app) | |
sess.visit("/") | |
puts "eval is nil" if sess.evaluate_script('parseInt(undefined)').nil? | |
puts "exec is nil" if sess.execute_script('parseInt(undefined)').nil? | |
__END__ | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<div id="mine"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment