Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 6 files changed
  • 0 comments
  • 1 contributor
1  .travis.yml
... ... @@ -1,5 +1,6 @@
1 1 language: ruby
2 2 rvm:
  3 + - 2.0.0
3 4 - 1.9.2
4 5 - 1.9.3
5 6 - rbx-19mode
2  README.md
Source Rendered
@@ -24,6 +24,8 @@ World do
24 24 end
25 25 ```
26 26
  27 +*For Capybara 2.0, make sure you are using prickle ≥ 0.1.0*
  28 +
27 29 ## Waiting for elements to become visible
28 30
29 31 To enable this feature you need to set the *Prickle::Capybara.wait_time* property.
4 lib/prickle/capybara/element.rb
@@ -37,8 +37,8 @@ def find_element
37 37 end
38 38
39 39 def find_element_by_xpath
40   - wait_until(Capybara.wait_time) do
41   - find(:xpath, xpath).visible?
  40 + Timeout.timeout(Capybara.wait_time) do
  41 + sleep(0.1) until find(:xpath, xpath).visible?
42 42 end unless Capybara.wait_time.nil?
43 43
44 44 find :xpath, xpath
2  lib/prickle/version.rb
... ... @@ -1,3 +1,3 @@
1 1 module Prickle
2   - VERSION = '0.0.6'
  2 + VERSION = '0.1.0'
3 3 end
2  prickle.gemspec
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22 22 s.add_dependency "capybara"
23 23
24 24 s.add_development_dependency "capybara"
25   - s.add_development_dependency "rspec", "~> 2.8.0"
  25 + s.add_development_dependency "rspec", "~> 2.13.0"
26 26 s.add_development_dependency "sinatra", "~> 1.3.2"
27 27 s.add_development_dependency "rake"
28 28 s.add_development_dependency "capybara-webkit"
4 spec/extended_wait_spec.rb
@@ -22,7 +22,7 @@
22 22
23 23 it "can fail if an element doesn't appear after the default wait time" do
24 24 Prickle::Capybara.wait_time = 1
25   - expect { prickly.element(:name => 'never_appear').contains_text? "I lag" }.to raise_error Capybara::TimeoutError
  25 + expect { prickly.element(:name => 'never_appear').contains_text? "I lag" }.to raise_error TimeoutError
26 26 end
27 27 end
28 28
@@ -36,7 +36,7 @@
36 36 context "clicking elements" do
37 37 it 'fails to click an element that has not appeared yet' do
38 38 Prickle::Capybara.wait_time = 1
39   - expect { prickly.click_by_name('lagged') }.to raise_error Capybara::TimeoutError
  39 + expect { prickly.click_by_name('lagged') }.to raise_error TimeoutError
40 40 end
41 41
42 42 it 'can click an element after it appears' do

No commit comments for this range

Something went wrong with that request. Please try again.