Last active
December 17, 2015 07:09
-
-
Save abotalov/5571262 to your computer and use it in GitHub Desktop.
Possible bug in Capybara
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' | |
require 'capybara-webkit' | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
Capybara.ignore_hidden_elements = true | |
session = Capybara::Session.new(:selenium, app) | |
session.visit("/") | |
session.find(:select, 'select_box_id', visible: false) | |
session.select('value', from: 'select_box_id', visible: false) # this triggers Capybara::ElementNotFound in 2.0.2 but doesn't trgigger it in 2.1 (it triggers Selenium::WebDriver::Error::ElementNotVisibleError if driver is :selenium in 2.1 as element is invisible) | |
__END__ | |
<!doctype html> | |
<html> | |
<body> | |
<select id="select_box_id" style="display:none"> | |
<option>default</option> | |
<option>value</option> | |
</select> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment