spreewald 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +3 -3
  5. data/Gemfile.ruby218.lock +2 -2
  6. data/README.md +1 -1
  7. data/features/binary.feature +2 -2
  8. data/lib/spreewald/web_steps.rb +8 -2
  9. data/lib/spreewald_support/version.rb +1 -1
  10. data/tests/rails-3_capybara-1/Gemfile +2 -1
  11. data/tests/rails-3_capybara-1/Gemfile.lock +24 -12
  12. data/tests/rails-3_capybara-1/app +1 -0
  13. data/tests/rails-3_capybara-1/config/cucumber.yml +1 -0
  14. data/tests/rails-3_capybara-1/config/database.yml +1 -0
  15. data/tests/rails-3_capybara-1/db +1 -0
  16. data/tests/rails-3_capybara-1/features/shared +1 -0
  17. data/tests/rails-3_capybara-1/features/support/paths.rb +1 -0
  18. data/tests/rails-3_capybara-1/features/support/selectors.rb +1 -0
  19. data/tests/rails-3_capybara-1/public +1 -0
  20. data/tests/rails-3_capybara-2/Gemfile +1 -1
  21. data/tests/rails-3_capybara-2/Gemfile.lock +18 -12
  22. data/tests/rails-3_capybara-2/Rakefile +1 -0
  23. data/tests/rails-3_capybara-2/app +1 -0
  24. data/tests/rails-3_capybara-2/config +1 -0
  25. data/tests/rails-3_capybara-2/db +1 -0
  26. data/tests/rails-3_capybara-2/features +1 -0
  27. data/tests/rails-3_capybara-2/public +1 -0
  28. data/tests/rails-4_capybara-3/Gemfile +2 -0
  29. data/tests/rails-4_capybara-3/Gemfile.lock +12 -0
  30. data/tests/rails-4_capybara-3/app +1 -0
  31. data/tests/rails-4_capybara-3/db +1 -0
  32. data/tests/rails-4_capybara-3/features/development_steps.feature +1 -0
  33. data/tests/rails-4_capybara-3/features/email_steps.feature +1 -0
  34. data/tests/rails-4_capybara-3/features/overriding.feature +1 -0
  35. data/tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb +1 -0
  36. data/tests/rails-4_capybara-3/features/step_definitions/test_steps.rb +1 -0
  37. data/tests/rails-4_capybara-3/features/support/paths.rb +1 -0
  38. data/tests/rails-4_capybara-3/features/support/selectors.rb +1 -0
  39. data/tests/rails-4_capybara-3/features/table_steps.feature +1 -0
  40. data/tests/rails-4_capybara-3/features/web_steps.feature +1 -0
  41. data/tests/shared/features/shared/step_definitions/test_steps.rb +13 -0
  42. data/tests/shared/features/shared/web_steps.feature +6 -0
  43. metadata +24 -2
  44. data/tests/rails-3_capybara-1/config/cucumber.yml +0 -2
  45. data/tests/rails-3_capybara-1/config/database.yml +0 -7
  46. data/tests/rails-3_capybara-1/features/support/paths.rb +0 -16
  47. data/tests/rails-3_capybara-1/features/support/selectors.rb +0 -52
  48. data/tests/rails-3_capybara-2/Rakefile +0 -18
  49. data/tests/rails-4_capybara-3/features/development_steps.feature +0 -8
  50. data/tests/rails-4_capybara-3/features/email_steps.feature +0 -224
  51. data/tests/rails-4_capybara-3/features/overriding.feature +0 -5
  52. data/tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb +0 -3
  53. data/tests/rails-4_capybara-3/features/step_definitions/test_steps.rb +0 -43
  54. data/tests/rails-4_capybara-3/features/support/paths.rb +0 -16
  55. data/tests/rails-4_capybara-3/features/support/selectors.rb +0 -52
  56. data/tests/rails-4_capybara-3/features/table_steps.feature +0 -293
  57. data/tests/rails-4_capybara-3/features/web_steps.feature +0 -214
@@ -0,0 +1 @@
1
+ tests/rails-4_capybara-3/features/../../shared/features/shared/table_steps.feature
@@ -0,0 +1 @@
1
+ tests/rails-4_capybara-3/features/../../shared/features/shared/web_steps.feature
@@ -1,3 +1,5 @@
1
+ require 'cucumber/rspec/doubles'
2
+
1
3
  RSPEC_EXPECTATION_NOT_MET_ERROR = RSpec::Expectations::ExpectationNotMetError
2
4
 
3
5
  Then /^the following steps? should (fail|succeed):$/ do |expectation, steps_table|
@@ -41,3 +43,14 @@ Then(/^a visible string with quotes should be visible$/) do
41
43
  visible_string = %Q{visible '" quotes}
42
44
  assert_visible(:text => visible_string)
43
45
  end
46
+
47
+ Then(/^'show me the page' should open the page or take a screenshot$/) do
48
+ # Projects with Capybara 1 & 2 use the launchy gem
49
+ if Capybara::VERSION < "3.0"
50
+ expect(Launchy).to receive(:open)
51
+ step 'show me the page'
52
+ else
53
+ expect_any_instance_of(Capybara::Screenshot::Saver).to receive(:save)
54
+ step 'show me the page'
55
+ end
56
+ end
@@ -212,3 +212,9 @@ Feature: Web steps
212
212
  Scenario: /^I perform basic authentication as "([^\"]*)\/([^\"]*)" and go to (.*)$/ with Javascript
213
213
  When I perform basic authentication as "user/password" and go to "/authenticated/page"
214
214
  Then I should see "Action reached"
215
+
216
+
217
+ @javascript
218
+ Scenario: /^show me the page$/
219
+ When I am on "/static_pages/home"
220
+ Then 'show me the page' should open the page or take a screenshot
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreewald
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
@@ -181,6 +181,7 @@ files:
181
181
  - tests/rails-3_capybara-1/Gemfile
182
182
  - tests/rails-3_capybara-1/Gemfile.lock
183
183
  - tests/rails-3_capybara-1/Rakefile
184
+ - tests/rails-3_capybara-1/app
184
185
  - tests/rails-3_capybara-1/config/application.rb
185
186
  - tests/rails-3_capybara-1/config/boot.rb
186
187
  - tests/rails-3_capybara-1/config/cucumber.yml
@@ -192,15 +193,23 @@ files:
192
193
  - tests/rails-3_capybara-1/config/initializers/secret_token.rb
193
194
  - tests/rails-3_capybara-1/config/initializers/session_store.rb
194
195
  - tests/rails-3_capybara-1/config/routes.rb
196
+ - tests/rails-3_capybara-1/db
197
+ - tests/rails-3_capybara-1/features/shared
195
198
  - tests/rails-3_capybara-1/features/support/env.rb
196
199
  - tests/rails-3_capybara-1/features/support/paths.rb
197
200
  - tests/rails-3_capybara-1/features/support/selectors.rb
198
201
  - tests/rails-3_capybara-1/features/support/selenium.rb
202
+ - tests/rails-3_capybara-1/public
199
203
  - tests/rails-3_capybara-2/.ruby-version
200
204
  - tests/rails-3_capybara-2/Gemfile
201
205
  - tests/rails-3_capybara-2/Gemfile.lock
202
206
  - tests/rails-3_capybara-2/Rakefile
207
+ - tests/rails-3_capybara-2/app
208
+ - tests/rails-3_capybara-2/config
203
209
  - tests/rails-3_capybara-2/config.ru
210
+ - tests/rails-3_capybara-2/db
211
+ - tests/rails-3_capybara-2/features
212
+ - tests/rails-3_capybara-2/public
204
213
  - tests/rails-3_capybara-2/script/cucumber
205
214
  - tests/rails-3_capybara-2/script/rails
206
215
  - tests/rails-4_capybara-3/.gitignore
@@ -208,6 +217,7 @@ files:
208
217
  - tests/rails-4_capybara-3/Gemfile.lock
209
218
  - tests/rails-4_capybara-3/README.rdoc
210
219
  - tests/rails-4_capybara-3/Rakefile
220
+ - tests/rails-4_capybara-3/app
211
221
  - tests/rails-4_capybara-3/bin/bundle
212
222
  - tests/rails-4_capybara-3/bin/rails
213
223
  - tests/rails-4_capybara-3/bin/rake
@@ -232,6 +242,7 @@ files:
232
242
  - tests/rails-4_capybara-3/config/locales/en.yml
233
243
  - tests/rails-4_capybara-3/config/routes.rb
234
244
  - tests/rails-4_capybara-3/config/secrets.yml
245
+ - tests/rails-4_capybara-3/db
235
246
  - tests/rails-4_capybara-3/features/development_steps.feature
236
247
  - tests/rails-4_capybara-3/features/email_steps.feature
237
248
  - tests/rails-4_capybara-3/features/overriding.feature
@@ -310,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
321
  version: '0'
311
322
  requirements: []
312
323
  rubyforge_project:
313
- rubygems_version: 2.2.5
324
+ rubygems_version: 2.6.14.3
314
325
  signing_key:
315
326
  specification_version: 4
316
327
  summary: Collection of useful cucumber steps.
@@ -319,6 +330,7 @@ test_files:
319
330
  - tests/rails-3_capybara-1/Gemfile
320
331
  - tests/rails-3_capybara-1/Gemfile.lock
321
332
  - tests/rails-3_capybara-1/Rakefile
333
+ - tests/rails-3_capybara-1/app
322
334
  - tests/rails-3_capybara-1/config/application.rb
323
335
  - tests/rails-3_capybara-1/config/boot.rb
324
336
  - tests/rails-3_capybara-1/config/cucumber.yml
@@ -330,15 +342,23 @@ test_files:
330
342
  - tests/rails-3_capybara-1/config/initializers/secret_token.rb
331
343
  - tests/rails-3_capybara-1/config/initializers/session_store.rb
332
344
  - tests/rails-3_capybara-1/config/routes.rb
345
+ - tests/rails-3_capybara-1/db
346
+ - tests/rails-3_capybara-1/features/shared
333
347
  - tests/rails-3_capybara-1/features/support/env.rb
334
348
  - tests/rails-3_capybara-1/features/support/paths.rb
335
349
  - tests/rails-3_capybara-1/features/support/selectors.rb
336
350
  - tests/rails-3_capybara-1/features/support/selenium.rb
351
+ - tests/rails-3_capybara-1/public
337
352
  - tests/rails-3_capybara-2/.ruby-version
338
353
  - tests/rails-3_capybara-2/Gemfile
339
354
  - tests/rails-3_capybara-2/Gemfile.lock
340
355
  - tests/rails-3_capybara-2/Rakefile
356
+ - tests/rails-3_capybara-2/app
357
+ - tests/rails-3_capybara-2/config
341
358
  - tests/rails-3_capybara-2/config.ru
359
+ - tests/rails-3_capybara-2/db
360
+ - tests/rails-3_capybara-2/features
361
+ - tests/rails-3_capybara-2/public
342
362
  - tests/rails-3_capybara-2/script/cucumber
343
363
  - tests/rails-3_capybara-2/script/rails
344
364
  - tests/rails-4_capybara-3/.gitignore
@@ -346,6 +366,7 @@ test_files:
346
366
  - tests/rails-4_capybara-3/Gemfile.lock
347
367
  - tests/rails-4_capybara-3/README.rdoc
348
368
  - tests/rails-4_capybara-3/Rakefile
369
+ - tests/rails-4_capybara-3/app
349
370
  - tests/rails-4_capybara-3/bin/bundle
350
371
  - tests/rails-4_capybara-3/bin/rails
351
372
  - tests/rails-4_capybara-3/bin/rake
@@ -370,6 +391,7 @@ test_files:
370
391
  - tests/rails-4_capybara-3/config/locales/en.yml
371
392
  - tests/rails-4_capybara-3/config/routes.rb
372
393
  - tests/rails-4_capybara-3/config/secrets.yml
394
+ - tests/rails-4_capybara-3/db
373
395
  - tests/rails-4_capybara-3/features/development_steps.feature
374
396
  - tests/rails-4_capybara-3/features/email_steps.feature
375
397
  - tests/rails-4_capybara-3/features/overriding.feature
@@ -1,2 +0,0 @@
1
- default: --require features --require features/shared features/shared
2
-
@@ -1,7 +0,0 @@
1
- development:
2
- adapter: sqlite3
3
- database: ":memory:"
4
-
5
- test:
6
- adapter: sqlite3
7
- database: ":memory:"
@@ -1,16 +0,0 @@
1
- module NavigationHelpers
2
-
3
- def path_to(page_name)
4
- case page_name
5
- when /^"(.*)"$/
6
- $1
7
-
8
- else
9
- raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
10
- "Now, go and add a mapping in #{__FILE__}"
11
- end
12
- end
13
-
14
- end
15
-
16
- World(NavigationHelpers)
@@ -1,52 +0,0 @@
1
- module HtmlSelectorsHelpers
2
- # Maps a name to a selector. Used primarily by the
3
- #
4
- # When /^(.+) within (.+)$/ do |step, scope|
5
- #
6
- # step definitions in web_steps.rb
7
- #
8
- def selector_for(locator)
9
- case locator
10
-
11
- when /^a panel?$/
12
- '.panel'
13
-
14
- when /^a panels nested contents?$/
15
- '.panel--nested-contents'
16
-
17
- when /^the timeline?$/
18
- '.timeline'
19
-
20
- when /^the table row containing "(.+?)"$/
21
- all('tr').detect { |tr| tr.text.include? $1 } || raise("Could not find tr containing #{$1.inspect}")
22
-
23
- when /^a table$/
24
- '.table'
25
-
26
- # Add more mappings here.
27
- # Here is an example that pulls values out of the Regexp:
28
- #
29
- # when /^the (notice|error|info) flash$/
30
- # ".flash.#{$1}"
31
-
32
- # You can also return an array to use a different selector
33
- # type, like:
34
- #
35
- # when /the header/
36
- # [:xpath, "//header"]
37
-
38
- # This allows you to provide a quoted selector as the scope
39
- # for "within" steps as was previously the default for the
40
- # web steps:
41
- when /^"(.+)"$/
42
- $1
43
-
44
- else
45
- raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
46
- "Now, go and add a mapping in #{__FILE__}"
47
- end
48
- end
49
-
50
- end
51
-
52
- World(HtmlSelectorsHelpers)
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env rake
2
- require 'cucumber/rake/task'
3
-
4
- desc 'Default: Run all specs for a specific rails version.'
5
- task :default => :features
6
-
7
- desc 'Run all specs for rails 3.2'
8
- Cucumber::Rake::Task.new(:features) do |t|
9
- feature = if ENV['SINGLE_FEATURE']
10
- "../../shared/features/shared/#{ ENV['SINGLE_FEATURE'] }"
11
- else
12
- 'features/shared'
13
- end
14
-
15
- # tell cucumber where it finds it files (subdirectories and symlinks are confusing it)
16
- t.cucumber_opts = "--require features --require features/shared #{feature}"
17
- end
18
-
@@ -1,8 +0,0 @@
1
- Feature: Development steps
2
-
3
- Scenario: /^it should work(.+?)?$/ (without a reason)
4
- Then it should work
5
-
6
- Scenario: /^it should work(.+?)?$/ (with a given reason)
7
- Then it should work once the blocker described here was fulfilled. (Feature should be pending)
8
-
@@ -1,224 +0,0 @@
1
- Feature: Test Spreewald's email steps
2
-
3
- Scenario: /^no e?mail should have been sent$/
4
- When I go to "/emails/do_nothing"
5
- Then the following step should succeed:
6
- | no email should have been sent |
7
-
8
- When I go to "/emails/send_email"
9
- Then the following step should fail:
10
- | no email should have been sent |
11
-
12
-
13
- Scenario: /^I should see "([^\"]*)" in the e?mail$/
14
- When I go to "/emails/send_email"
15
- Then the following step should succeed:
16
- | I should see "Body" in the email |
17
- But the following step should fail:
18
- | I should see "XYZ" in the email |
19
-
20
-
21
- Scenario: /^(an|no) e?mail should have been sent with:$/
22
- When I go to "/emails/send_email"
23
-
24
- # Test without body
25
- Then the following multiline step should succeed:
26
- """
27
- Then an email should have been sent with:
28
- '''
29
- From: from@example.com
30
- Reply-To: reply-to@example.com
31
- To: to@example.com
32
- Subject: SUBJECT
33
- '''
34
- """
35
-
36
- # Test with body
37
- Then the following multiline step should succeed:
38
- """
39
- Then an email should have been sent with:
40
- '''
41
- From: from@example.com
42
- Reply-To: reply-to@example.com
43
- To: to@example.com
44
- Subject: SUBJECT
45
-
46
- Body
47
- with
48
- line
49
- breaks
50
- '''
51
- """
52
-
53
- # Test with incorrect From header
54
- Then the following multiline step should fail:
55
- """
56
- Then an email should have been sent with:
57
- '''
58
- From: other-from@example.com
59
- Reply-To: reply-to@example.com
60
- To: to@example.com
61
- Subject: SUBJECT
62
-
63
- Body
64
- with
65
- line
66
- breaks
67
- '''
68
- """
69
-
70
- # Test with incorrect Reply-To header
71
- Then the following multiline step should fail:
72
- """
73
- Then an email should have been sent with:
74
- '''
75
- From: from@example.com
76
- Reply-To: other-reply-to@example.com
77
- To: to@example.com
78
- Subject: SUBJECT
79
-
80
- Body
81
- with
82
- line
83
- breaks
84
- '''
85
- """
86
- # Test with incorrect To header
87
- Then the following multiline step should fail:
88
- """
89
- Then an email should have been sent with:
90
- '''
91
- From: from@example.com
92
- Reply-To: reply-to@example.com
93
- To: other-to@example.com
94
- Subject: SUBJECT
95
-
96
- Body
97
- with
98
- line
99
- breaks
100
- '''
101
- """
102
-
103
- # Test with incorrect Subject header
104
- Then the following multiline step should fail:
105
- """
106
- Then an email should have been sent with:
107
- '''
108
- From: from@example.com
109
- Reply-To: reply-to@example.com
110
- To: to@example.com
111
- Subject: OTHER-SUBJECT
112
-
113
- Body
114
- with
115
- line
116
- breaks
117
- '''
118
- """
119
-
120
- # Test with incorrect body
121
- Then the following multiline step should fail:
122
- """
123
- Then an email should have been sent with:
124
- '''
125
- From: from@example.com
126
- Reply-To: reply-to@example.com
127
- To: to@example.com
128
- Subject: SUBJECT
129
-
130
- Other body
131
- with
132
- line
133
- breaks
134
- '''
135
- """
136
-
137
- # Test body with multiple paragraphs
138
- Then the following multiline step should fail:
139
- """
140
- Then an email should have been sent with:
141
- '''
142
- From: from@example.com
143
- Reply-To: reply-to@example.com
144
- To: to@example.com
145
- Subject: SUBJECT
146
-
147
- Body
148
- with
149
- line
150
- breaks
151
-
152
- MORE-BODY
153
- '''
154
- """
155
-
156
- Scenario: /^(an|no) e?mail should have been sent((?: |and|with|from "[^"]+"|bcc "[^"]+"|cc "[^"]+"|to "[^"]+"|the subject "[^"]+"|the body "[^"]+"|the attachments "[^"]+")+)$/
157
- When I go to "/emails/send_email"
158
-
159
- # Test with correct conditions
160
- Then the following multiline step should succeed:
161
- """
162
- Then an email should have been sent from "from@example.com" to "to@example.com" cc "cc@example.com" bcc "bcc@example.com" and the subject "SUBJECT" and the attachments "attached_file.pdf"
163
- """
164
-
165
- # Test with wrong conditions
166
- Then the following multiline step should fail:
167
- """
168
- Then an email should have been sent from "from@example.com" to "to@example.com" cc "cc@example.com" bcc "wrong_bcc@example.com" and the subject "SUBJECT" and the attachments "attached_file.pdf"
169
- """
170
-
171
- Scenario: /^that e?mail should have the following lines in the body:$/
172
- When I go to "/emails/send_email"
173
- Then an email should have been sent with:
174
- """
175
- From: from@example.com
176
- """
177
-
178
- # Test with correct body lines
179
- Then the following multiline step should succeed:
180
- """
181
- Then that email should have the following lines in the body:
182
- '''
183
- with
184
- line
185
- '''
186
- """
187
-
188
- # Test with wrong body lines
189
- Then the following multiline step should fail:
190
- """
191
- Then that email should have the following lines in the body:
192
- '''
193
- wrong
194
- line
195
- '''
196
- """
197
-
198
-
199
- Scenario: /^that e?mail should have the following body:$/
200
- When I go to "/emails/send_email"
201
- Then an email should have been sent with:
202
- """
203
- From: from@example.com
204
- """
205
-
206
- # Test with correct body lines
207
- Then the following multiline step should succeed:
208
- """
209
- Then that email should have the following body:
210
- '''
211
- with
212
- line
213
- '''
214
- """
215
-
216
- # Test with wrong body lines
217
- Then the following multiline step should fail:
218
- """
219
- Then that email should have the following body:
220
- '''
221
- wrong
222
- line
223
- '''
224
- """