spreewald 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -35,6 +35,12 @@ Spreewald's web steps are all aware that you might run them with a Selenium/Capy
35
35
 
36
36
  This is done by rerunning any assertions until they suceed or a timeout is reached.
37
37
 
38
+ We consider a couple of potential exceptions as "retriable", including
39
+ Capybara::ElementNotFound, (R)Spec::Expectations::ExpectationNotMetError, Capybara::Poltergeist::ClickFailed
40
+
41
+ You can add your own error class with
42
+ ToleranceForSeleniumSyncIssues::RETRY_ERRORS << 'MyCustomError'
43
+
38
44
  You can achieve this in your own steps by wrapping them inside a `patiently do` block, like
39
45
 
40
46
  Then /^I should see "([^\"]*)" in the HTML$/ do |text|
@@ -425,6 +431,16 @@ deprecation notice. Decide for yourself whether you want to use them:
425
431
  Click on some text that might not be a link
426
432
 
427
433
 
434
+ * **Then "..." should link to "..."/**
435
+
436
+ Use this step to check external links.
437
+
438
+ Example:
439
+
440
+ Then "Sponsor" should link to "http://makandra.com"
441
+
442
+
443
+
428
444
  * **Then I should (not )?see an element "..."**
429
445
 
430
446
  Example:
@@ -442,6 +442,19 @@ When /^I click on "([^\"]+)"$/ do |text|
442
442
  end
443
443
  end
444
444
 
445
+ # Use this step to check external links.
446
+ #
447
+ # Example:
448
+ #
449
+ # Then "Sponsor" should link to "http://makandra.com"
450
+ #
451
+ Then /^"([^"]*)" should link to "([^"]*)"$/ do |link_label, target|
452
+ patiently do
453
+ link = find_link(link_label)
454
+ link[:href].should =~ /#{Regexp.escape target}$/
455
+ end
456
+ end
457
+
445
458
  # Example:
446
459
  #
447
460
  # Then I should see an element ".page .container"
@@ -1,6 +1,8 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module ToleranceForSeleniumSyncIssues
4
+ RETRY_ERRORS = %w[Capybara::ElementNotFound Spec::Expectations::ExpectationNotMetError RSpec::Expectations::ExpectationNotMetError Capybara::Poltergeist::ClickFailed]
5
+
4
6
  # This is similiar but not entirely the same as Capybara::Node::Base#wait_until or Capybara::Session#wait_until
5
7
  def patiently(seconds=Capybara.default_wait_time, &block)
6
8
  old_wait_time = Capybara.default_wait_time
@@ -10,7 +12,8 @@ module ToleranceForSeleniumSyncIssues
10
12
  start_time = Time.now
11
13
  begin
12
14
  block.call
13
- rescue => e
15
+ rescue Exception => e
16
+ raise e unless RETRY_ERRORS.include?(e.class.name)
14
17
  raise e if (Time.now - start_time) >= seconds
15
18
  sleep(0.05)
16
19
  raise Capybara::FrozenInTime, "time appears to be frozen, Capybara does not work with libraries which freeze time, consider using time travelling instead" if Time.now == start_time
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module Spreewald
4
- VERSION = "0.5.5"
4
+ VERSION = "0.5.6"
5
5
  end
metadata CHANGED
@@ -1,72 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
- version: !ruby/object:Gem::Version
4
- version: 0.5.5
3
+ version: !ruby/object:Gem::Version
4
+ hash: 7
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 5
9
+ - 6
10
+ version: 0.5.6
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Tobias Kraze
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2013-03-12 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2013-03-15 00:00:00 +01:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
15
22
  name: cucumber-rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: cucumber
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
38
33
  type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: cucumber
39
37
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
38
+ requirement: &id002 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: capybara
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
54
47
  type: :runtime
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: capybara
55
51
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
52
+ requirement: &id003 !ruby/object:Gem::Requirement
57
53
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- description: A collection of cucumber steps we use in our projects, including steps
63
- to check HTML, tables, emails and some utility methods.
64
- email:
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :runtime
62
+ version_requirements: *id003
63
+ description: A collection of cucumber steps we use in our projects, including steps to check HTML, tables, emails and some utility methods.
64
+ email:
65
65
  - tobias@kraze.eu
66
66
  executables: []
67
+
67
68
  extensions: []
69
+
68
70
  extra_rdoc_files: []
69
- files:
71
+
72
+ files:
70
73
  - .gitignore
71
74
  - Gemfile
72
75
  - LICENSE
@@ -90,28 +93,39 @@ files:
90
93
  - lib/spreewald_support/version.rb
91
94
  - spreewald.gemspec
92
95
  - support/documentation_generator.rb
96
+ has_rdoc: true
93
97
  homepage: https://github.com/makandra/spreewald
94
98
  licenses: []
99
+
95
100
  post_install_message:
96
101
  rdoc_options: []
97
- require_paths:
102
+
103
+ require_paths:
98
104
  - lib
99
- required_ruby_version: !ruby/object:Gem::Requirement
105
+ required_ruby_version: !ruby/object:Gem::Requirement
100
106
  none: false
101
- requirements:
102
- - - ! '>='
103
- - !ruby/object:Gem::Version
104
- version: '0'
105
- required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ hash: 3
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
115
  none: false
107
- requirements:
108
- - - ! '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ hash: 3
120
+ segments:
121
+ - 0
122
+ version: "0"
111
123
  requirements: []
124
+
112
125
  rubyforge_project:
113
- rubygems_version: 1.8.24
126
+ rubygems_version: 1.3.9.5
114
127
  signing_key:
115
128
  specification_version: 3
116
129
  summary: Collection of useful cucumber steps.
117
130
  test_files: []
131
+