Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

wait_until has been deprecated so using Timeout

instead.
  • Loading branch information...
commit 6e69e68db7ad258ae80a5894a09d33378725d134 1 parent edb74d7
@despo despo authored
View
4 lib/prickle/capybara/element.rb
@@ -37,8 +37,8 @@ def find_element
end
def find_element_by_xpath
- wait_until(Capybara.wait_time) do
- find(:xpath, xpath).visible?
+ Timeout.timeout(Capybara.wait_time) do
+ sleep(0.1) until find(:xpath, xpath).visible?
end unless Capybara.wait_time.nil?
find :xpath, xpath
View
2  prickle.gemspec
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.add_dependency "capybara"
- s.add_development_dependency "capybara"
+ s.add_development_dependency "capybara", "~> 2.0.0"
s.add_development_dependency "rspec", "~> 2.13.0"
s.add_development_dependency "sinatra", "~> 1.3.2"
s.add_development_dependency "rake"
View
4 spec/extended_wait_spec.rb
@@ -22,7 +22,7 @@
it "can fail if an element doesn't appear after the default wait time" do
Prickle::Capybara.wait_time = 1
- expect { prickly.element(:name => 'never_appear').contains_text? "I lag" }.to raise_error Capybara::TimeoutError
+ expect { prickly.element(:name => 'never_appear').contains_text? "I lag" }.to raise_error TimeoutError
end
end
@@ -36,7 +36,7 @@
context "clicking elements" do
it 'fails to click an element that has not appeared yet' do
Prickle::Capybara.wait_time = 1
- expect { prickly.click_by_name('lagged') }.to raise_error Capybara::TimeoutError
+ expect { prickly.click_by_name('lagged') }.to raise_error TimeoutError
end
it 'can click an element after it appears' do
Please sign in to comment.
Something went wrong with that request. Please try again.