mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix failing specs
This commit is contained in:
parent
2e87d1dcd5
commit
195ca37178
5 changed files with 17 additions and 17 deletions
|
@ -44,7 +44,7 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
|
|||
end
|
||||
|
||||
def visible?
|
||||
node.displayed?
|
||||
node.displayed? and node.displayed? != "false"
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -47,10 +47,12 @@ module Capybara
|
|||
end
|
||||
|
||||
SESSION_METHODS = [
|
||||
:visit, :current_url, :body, :click_link, :click_button, :drag, :fill_in, :choose, :has_xpath?, :has_css?,
|
||||
:check, :uncheck, :attach_file, :select, :has_content?, :within, :within_fieldset,
|
||||
:within_table, :save_and_open_page, :find, :find_field, :find_link, :find_button,
|
||||
:field_labeled, :all, :wait_for, :wait_for_condition, :evaluate_script, :click
|
||||
:visit, :current_url, :body, :click_link, :click_button, :drag, :fill_in,
|
||||
:choose, :has_xpath?, :has_css?, :check, :uncheck, :attach_file, :select,
|
||||
:has_content?, :within, :within_fieldset, :within_table,
|
||||
:save_and_open_page, :find, :find_field, :find_link, :find_button,
|
||||
:field_labeled, :all, :wait_for, :wait_for_condition, :evaluate_script,
|
||||
:click, :wait_until
|
||||
]
|
||||
SESSION_METHODS.each do |method|
|
||||
class_eval <<-RUBY, __FILE__, __LINE__+1
|
||||
|
|
|
@ -155,16 +155,15 @@ module Capybara
|
|||
|
||||
def wait_until(timeout = Capybara.default_wait_timeout, &block)
|
||||
return yield unless driver.wait?
|
||||
|
||||
|
||||
returned = nil
|
||||
|
||||
Timeout.timeout(timeout) do
|
||||
until returned = yield
|
||||
sleep(0.1)
|
||||
end
|
||||
Timeout.timeout(timeout) do
|
||||
sleep(0.1) until returned = yield
|
||||
end
|
||||
|
||||
returned
|
||||
rescue Timeout::Error
|
||||
return false
|
||||
else
|
||||
return returned
|
||||
end
|
||||
|
||||
def evaluate_script(script)
|
||||
|
|
|
@ -64,11 +64,10 @@ shared_examples_for 'driver' do
|
|||
end
|
||||
|
||||
it "should extract node visibility" do
|
||||
|
||||
@driver.find('//a')[0].should be_visible
|
||||
|
||||
@driver.find('//*[@id="hidden"]')[0].should_not be_visible
|
||||
@driver.find('//*[@id="hidden_via_ancestor"]')[0].should_not be_visible
|
||||
@driver.find('//div[@id="hidden"]')[0].should_not be_visible
|
||||
@driver.find('//div[@id="hidden_via_ancestor"]')[0].should_not be_visible
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,5 +19,5 @@
|
|||
</p>
|
||||
|
||||
<div id="hidden" style="display:none;">
|
||||
<div id="hidden_via_ancestor">Inside element with hidden ancestor</div>
|
||||
<div id="hidden_via_ancestor">Inside element with hidden ancestor</div>
|
||||
</div>
|
Loading…
Reference in a new issue