spreewald 1.12.1 → 1.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +0 -3
- data/Rakefile +1 -1
- data/lib/spreewald.rb +0 -1
- data/lib/spreewald/table_steps.rb +1 -0
- data/lib/spreewald/web_steps.rb +14 -12
- data/lib/spreewald_support/compatibility.rb +1 -0
- data/lib/spreewald_support/custom_matchers.rb +2 -0
- data/lib/spreewald_support/driver_info.rb +23 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/lib/spreewald_support/web_steps_helpers.rb +1 -2
- data/tests/rails-3_capybara-1/Gemfile.lock +3 -3
- data/tests/rails-3_capybara-1/app +1 -0
- data/tests/rails-3_capybara-1/config/cucumber.yml +1 -0
- data/tests/rails-3_capybara-1/config/database.yml +1 -0
- data/tests/rails-3_capybara-1/db +1 -0
- data/tests/rails-3_capybara-1/features/shared +1 -0
- data/tests/rails-3_capybara-1/features/support/paths.rb +1 -0
- data/tests/rails-3_capybara-1/features/support/selectors.rb +1 -0
- data/tests/rails-3_capybara-1/public +1 -0
- data/tests/rails-3_capybara-2/Gemfile.lock +2 -2
- data/tests/rails-3_capybara-2/Rakefile +1 -0
- data/tests/rails-3_capybara-2/app +1 -0
- data/tests/rails-3_capybara-2/config +1 -0
- data/tests/rails-3_capybara-2/db +1 -0
- data/tests/rails-3_capybara-2/features +1 -0
- data/tests/rails-3_capybara-2/public +1 -0
- data/tests/rails-4_capybara-3/Gemfile.lock +1 -1
- data/tests/rails-4_capybara-3/app +1 -0
- data/tests/rails-4_capybara-3/db +1 -0
- data/tests/rails-4_capybara-3/features/email_steps.feature +1 -0
- data/tests/rails-4_capybara-3/features/overriding.feature +1 -0
- data/tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb +1 -0
- data/tests/rails-4_capybara-3/features/step_definitions/test_steps.rb +1 -0
- data/tests/rails-4_capybara-3/features/support/paths.rb +1 -0
- data/tests/rails-4_capybara-3/features/support/selectors.rb +1 -0
- data/tests/rails-4_capybara-3/features/table_steps.feature +1 -0
- data/tests/rails-4_capybara-3/features/web_steps.feature +1 -0
- metadata +26 -3
- data/tests/rails-3_capybara-1/config/cucumber.yml +0 -2
- data/tests/rails-3_capybara-1/config/database.yml +0 -7
- data/tests/rails-3_capybara-1/features/support/paths.rb +0 -16
- data/tests/rails-3_capybara-1/features/support/selectors.rb +0 -46
- data/tests/rails-3_capybara-2/Rakefile +0 -18
- data/tests/rails-4_capybara-3/features/email_steps.feature +0 -131
- data/tests/rails-4_capybara-3/features/overriding.feature +0 -5
- data/tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb +0 -3
- data/tests/rails-4_capybara-3/features/step_definitions/test_steps.rb +0 -43
- data/tests/rails-4_capybara-3/features/support/paths.rb +0 -16
- data/tests/rails-4_capybara-3/features/support/selectors.rb +0 -46
- data/tests/rails-4_capybara-3/features/table_steps.feature +0 -292
- data/tests/rails-4_capybara-3/features/web_steps.feature +0 -152
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28fbd2d2c91e4365c7687dd78ee0175bccbd18ba
|
4
|
+
data.tar.gz: 58d1e39503525373f550e219f4df928372003c3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4686d1d4ef1ec2d9e9de2dcd0bdbff055e5134a7f39e557b599615f89a4893618c6a5302d42d9994da71c9cde0ea07103d4025a97b57a330ed59a6935448ff9c
|
7
|
+
data.tar.gz: cd0bb2f7aaaaa4991af4b82d006af9da7adaf0818ba822d3b63f196dd4916e49882608447db9906334e58195ea4e47dcfa72cbecd84b9771c2ea1271462e366f
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,9 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## 1.12.2
|
10
|
+
Always check the current driver by its class (see [issue](https://github.com/makandra/spreewald/issues/74))
|
11
|
+
|
9
12
|
## 1.12.1
|
10
13
|
- Remove deprecation warnings because of `failure_message_for_should` and `failure_message_for_should_not`
|
11
14
|
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/lib/spreewald.rb
CHANGED
data/lib/spreewald/web_steps.rb
CHANGED
@@ -29,6 +29,7 @@ require 'spreewald_support/path_selector_fallbacks'
|
|
29
29
|
require 'spreewald_support/step_fallback'
|
30
30
|
require 'spreewald_support/custom_matchers'
|
31
31
|
require 'spreewald_support/web_steps_helpers'
|
32
|
+
require 'spreewald_support/driver_info'
|
32
33
|
require 'uri'
|
33
34
|
require 'cgi'
|
34
35
|
|
@@ -432,13 +433,12 @@ Then /^the window should be titled "([^"]*)"$/ do |title|
|
|
432
433
|
end.overridable
|
433
434
|
|
434
435
|
When /^I reload the page$/ do
|
435
|
-
|
436
|
-
|
437
|
-
page.execute_script(<<-JAVASCRIPT)
|
436
|
+
if javascript_capable?
|
437
|
+
page.execute_script(<<-JAVASCRIPT)
|
438
438
|
window.location.reload(true);
|
439
|
-
|
440
|
-
|
441
|
-
|
439
|
+
JAVASCRIPT
|
440
|
+
else
|
441
|
+
visit current_path
|
442
442
|
end
|
443
443
|
end.overridable
|
444
444
|
|
@@ -612,8 +612,11 @@ When /^I enter "([^"]*)" into the browser dialog$/ do |text|
|
|
612
612
|
end.overridable
|
613
613
|
|
614
614
|
When /^I switch to the new tab$/ do
|
615
|
-
|
616
|
-
|
615
|
+
if javascript_capable?
|
616
|
+
page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
|
617
|
+
else
|
618
|
+
raise("This step works only with selenium")
|
619
|
+
end
|
617
620
|
end.overridable
|
618
621
|
|
619
622
|
# Checks that these strings are rendered in the given order in a single line or in multiple lines
|
@@ -676,7 +679,7 @@ end.overridable
|
|
676
679
|
#
|
677
680
|
# More details [here](https://makandracards.com/makandra/12139-waiting-for-page-loads-and-ajax-requests-to-finish-with-capybara).
|
678
681
|
When /^I wait for the page to load$/ do
|
679
|
-
if
|
682
|
+
if javascript_capable?
|
680
683
|
patiently do
|
681
684
|
# when no jQuery is loaded, we assume there are no pending AJAX requests
|
682
685
|
page.execute_script("return typeof jQuery === 'undefined' || $.active == 0;").should == true
|
@@ -690,7 +693,7 @@ end.overridable
|
|
690
693
|
# More details [here](https://makandracards.com/makandra/971-perform-http-basic-authentication-in-cucumber).
|
691
694
|
When /^I perform basic authentication as "([^\"]*)\/([^\"]*)" and go to (.*)$/ do |user, password, page_name|
|
692
695
|
path = _path_to(page_name)
|
693
|
-
if
|
696
|
+
if javascript_capable?
|
694
697
|
server = Capybara.current_session.server rescue Capybara.current_session.driver.rack_server
|
695
698
|
visit("http://#{user}:#{password}@#{server.host}:#{server.port}#{path}")
|
696
699
|
else
|
@@ -707,8 +710,7 @@ end.overridable
|
|
707
710
|
|
708
711
|
# Goes to the previously viewed page.
|
709
712
|
When /^I go back$/ do
|
710
|
-
|
711
|
-
when :selenium, :webkit
|
713
|
+
if javascript_capable?
|
712
714
|
page.execute_script('window.history.back()')
|
713
715
|
else
|
714
716
|
if page.driver.respond_to?(:browser)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Spreewald
|
2
|
+
module DriverInfo
|
3
|
+
|
4
|
+
def javascript_capable?
|
5
|
+
selenium_driver? || poltergeist_driver? || webkit_driver?
|
6
|
+
end
|
7
|
+
|
8
|
+
def selenium_driver?
|
9
|
+
Object.const_defined?('Capybara::Selenium') && Capybara.current_session.driver.is_a?(Capybara::Selenium::Driver)
|
10
|
+
end
|
11
|
+
|
12
|
+
def poltergeist_driver?
|
13
|
+
Object.const_defined?('Capybara::Poltergeist') && Capybara.current_session.driver.is_a?(Capybara::Poltergeist::Driver)
|
14
|
+
end
|
15
|
+
|
16
|
+
def webkit_driver?
|
17
|
+
Object.const_defined?('Capybara::Webkit') && Capybara.current_session.driver.is_a?(Capybara::Webkit::Driver)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
World(Spreewald::DriverInfo)
|
@@ -11,8 +11,7 @@ module WebStepsHelpers
|
|
11
11
|
private
|
12
12
|
|
13
13
|
def visibility_test(options)
|
14
|
-
|
15
|
-
when :selenium, :webkit, :poltergeist
|
14
|
+
if javascript_capable?
|
16
15
|
detect_visibility_with_js(options)
|
17
16
|
else
|
18
17
|
detect_visibility_with_capybara(options)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../..
|
3
3
|
specs:
|
4
|
-
spreewald (1.12.
|
4
|
+
spreewald (1.12.2)
|
5
5
|
cucumber
|
6
6
|
cucumber_priority (>= 0.3.0)
|
7
7
|
|
@@ -57,7 +57,7 @@ GEM
|
|
57
57
|
cucumber (>= 1.2.0)
|
58
58
|
nokogiri (>= 1.5.0)
|
59
59
|
rails (>= 3.0.0)
|
60
|
-
cucumber_priority (0.3.
|
60
|
+
cucumber_priority (0.3.2)
|
61
61
|
cucumber
|
62
62
|
database_cleaner (1.0.1)
|
63
63
|
diff-lcs (1.3)
|
@@ -160,4 +160,4 @@ DEPENDENCIES
|
|
160
160
|
sqlite3
|
161
161
|
|
162
162
|
BUNDLED WITH
|
163
|
-
1.17.
|
163
|
+
1.17.3
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/../shared/app
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/config/../../shared/config/cucumber.yml
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/config/../../shared/config/database.yml
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/../shared/db
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/features/../../shared/features/shared
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/features/support/../../../shared/features/support/paths.rb
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/features/support/../../../shared/features/support/selectors.rb
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-1/../shared/public
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-2/../rails-3_capybara-1/Rakefile
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-2/../rails-3_capybara-1/app
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-2/../rails-3_capybara-1/config
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-2/../rails-3_capybara-1/db
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-2/../rails-3_capybara-1/features/
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-3_capybara-2/../rails-3_capybara-1/public
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/../shared/app/
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/../shared/db/
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/features/../../shared/features/shared/email_steps.feature
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/features/../../shared/features/shared/overriding.feature
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/features/step_definitions/../../../shared/features/shared/step_definitions/
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/features/step_definitions/../../../shared/features/shared/step_definitions/
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/features/support/../../../shared/features/support/paths.rb
|
@@ -0,0 +1 @@
|
|
1
|
+
tests/rails-4_capybara-3/features/support/../../../shared/features/support/selectors.rb
|
@@ -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
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- lib/spreewald/web_steps.rb
|
161
161
|
- lib/spreewald_support/compatibility.rb
|
162
162
|
- lib/spreewald_support/custom_matchers.rb
|
163
|
+
- lib/spreewald_support/driver_info.rb
|
163
164
|
- lib/spreewald_support/github.rb
|
164
165
|
- lib/spreewald_support/mail_finder.rb
|
165
166
|
- lib/spreewald_support/path_selector_fallbacks.rb
|
@@ -180,6 +181,7 @@ files:
|
|
180
181
|
- tests/rails-3_capybara-1/Gemfile
|
181
182
|
- tests/rails-3_capybara-1/Gemfile.lock
|
182
183
|
- tests/rails-3_capybara-1/Rakefile
|
184
|
+
- tests/rails-3_capybara-1/app
|
183
185
|
- tests/rails-3_capybara-1/config/application.rb
|
184
186
|
- tests/rails-3_capybara-1/config/boot.rb
|
185
187
|
- tests/rails-3_capybara-1/config/cucumber.yml
|
@@ -191,15 +193,23 @@ files:
|
|
191
193
|
- tests/rails-3_capybara-1/config/initializers/secret_token.rb
|
192
194
|
- tests/rails-3_capybara-1/config/initializers/session_store.rb
|
193
195
|
- tests/rails-3_capybara-1/config/routes.rb
|
196
|
+
- tests/rails-3_capybara-1/db
|
197
|
+
- tests/rails-3_capybara-1/features/shared
|
194
198
|
- tests/rails-3_capybara-1/features/support/env.rb
|
195
199
|
- tests/rails-3_capybara-1/features/support/paths.rb
|
196
200
|
- tests/rails-3_capybara-1/features/support/selectors.rb
|
197
201
|
- tests/rails-3_capybara-1/features/support/selenium.rb
|
202
|
+
- tests/rails-3_capybara-1/public
|
198
203
|
- tests/rails-3_capybara-2/.ruby-version
|
199
204
|
- tests/rails-3_capybara-2/Gemfile
|
200
205
|
- tests/rails-3_capybara-2/Gemfile.lock
|
201
206
|
- tests/rails-3_capybara-2/Rakefile
|
207
|
+
- tests/rails-3_capybara-2/app
|
208
|
+
- tests/rails-3_capybara-2/config
|
202
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
|
203
213
|
- tests/rails-3_capybara-2/script/cucumber
|
204
214
|
- tests/rails-3_capybara-2/script/rails
|
205
215
|
- tests/rails-4_capybara-3/.gitignore
|
@@ -207,6 +217,7 @@ files:
|
|
207
217
|
- tests/rails-4_capybara-3/Gemfile.lock
|
208
218
|
- tests/rails-4_capybara-3/README.rdoc
|
209
219
|
- tests/rails-4_capybara-3/Rakefile
|
220
|
+
- tests/rails-4_capybara-3/app
|
210
221
|
- tests/rails-4_capybara-3/bin/bundle
|
211
222
|
- tests/rails-4_capybara-3/bin/rails
|
212
223
|
- tests/rails-4_capybara-3/bin/rake
|
@@ -231,6 +242,7 @@ files:
|
|
231
242
|
- tests/rails-4_capybara-3/config/locales/en.yml
|
232
243
|
- tests/rails-4_capybara-3/config/routes.rb
|
233
244
|
- tests/rails-4_capybara-3/config/secrets.yml
|
245
|
+
- tests/rails-4_capybara-3/db
|
234
246
|
- tests/rails-4_capybara-3/features/email_steps.feature
|
235
247
|
- tests/rails-4_capybara-3/features/overriding.feature
|
236
248
|
- tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb
|
@@ -304,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
304
316
|
version: '0'
|
305
317
|
requirements: []
|
306
318
|
rubyforge_project:
|
307
|
-
rubygems_version: 2.
|
319
|
+
rubygems_version: 2.6.14.3
|
308
320
|
signing_key:
|
309
321
|
specification_version: 4
|
310
322
|
summary: Collection of useful cucumber steps.
|
@@ -313,6 +325,7 @@ test_files:
|
|
313
325
|
- tests/rails-3_capybara-1/Gemfile
|
314
326
|
- tests/rails-3_capybara-1/Gemfile.lock
|
315
327
|
- tests/rails-3_capybara-1/Rakefile
|
328
|
+
- tests/rails-3_capybara-1/app
|
316
329
|
- tests/rails-3_capybara-1/config/application.rb
|
317
330
|
- tests/rails-3_capybara-1/config/boot.rb
|
318
331
|
- tests/rails-3_capybara-1/config/cucumber.yml
|
@@ -324,15 +337,23 @@ test_files:
|
|
324
337
|
- tests/rails-3_capybara-1/config/initializers/secret_token.rb
|
325
338
|
- tests/rails-3_capybara-1/config/initializers/session_store.rb
|
326
339
|
- tests/rails-3_capybara-1/config/routes.rb
|
340
|
+
- tests/rails-3_capybara-1/db
|
341
|
+
- tests/rails-3_capybara-1/features/shared
|
327
342
|
- tests/rails-3_capybara-1/features/support/env.rb
|
328
343
|
- tests/rails-3_capybara-1/features/support/paths.rb
|
329
344
|
- tests/rails-3_capybara-1/features/support/selectors.rb
|
330
345
|
- tests/rails-3_capybara-1/features/support/selenium.rb
|
346
|
+
- tests/rails-3_capybara-1/public
|
331
347
|
- tests/rails-3_capybara-2/.ruby-version
|
332
348
|
- tests/rails-3_capybara-2/Gemfile
|
333
349
|
- tests/rails-3_capybara-2/Gemfile.lock
|
334
350
|
- tests/rails-3_capybara-2/Rakefile
|
351
|
+
- tests/rails-3_capybara-2/app
|
352
|
+
- tests/rails-3_capybara-2/config
|
335
353
|
- tests/rails-3_capybara-2/config.ru
|
354
|
+
- tests/rails-3_capybara-2/db
|
355
|
+
- tests/rails-3_capybara-2/features
|
356
|
+
- tests/rails-3_capybara-2/public
|
336
357
|
- tests/rails-3_capybara-2/script/cucumber
|
337
358
|
- tests/rails-3_capybara-2/script/rails
|
338
359
|
- tests/rails-4_capybara-3/.gitignore
|
@@ -340,6 +361,7 @@ test_files:
|
|
340
361
|
- tests/rails-4_capybara-3/Gemfile.lock
|
341
362
|
- tests/rails-4_capybara-3/README.rdoc
|
342
363
|
- tests/rails-4_capybara-3/Rakefile
|
364
|
+
- tests/rails-4_capybara-3/app
|
343
365
|
- tests/rails-4_capybara-3/bin/bundle
|
344
366
|
- tests/rails-4_capybara-3/bin/rails
|
345
367
|
- tests/rails-4_capybara-3/bin/rake
|
@@ -364,6 +386,7 @@ test_files:
|
|
364
386
|
- tests/rails-4_capybara-3/config/locales/en.yml
|
365
387
|
- tests/rails-4_capybara-3/config/routes.rb
|
366
388
|
- tests/rails-4_capybara-3/config/secrets.yml
|
389
|
+
- tests/rails-4_capybara-3/db
|
367
390
|
- tests/rails-4_capybara-3/features/email_steps.feature
|
368
391
|
- tests/rails-4_capybara-3/features/overriding.feature
|
369
392
|
- tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb
|
@@ -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,46 +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 /^the timeline?$/
|
15
|
-
'.timeline'
|
16
|
-
|
17
|
-
when /^the table row containing "(.+?)"$/
|
18
|
-
all('tr').detect { |tr| tr.text.include? $1 } || raise("Could not find tr containing #{$1.inspect}")
|
19
|
-
|
20
|
-
# Add more mappings here.
|
21
|
-
# Here is an example that pulls values out of the Regexp:
|
22
|
-
#
|
23
|
-
# when /^the (notice|error|info) flash$/
|
24
|
-
# ".flash.#{$1}"
|
25
|
-
|
26
|
-
# You can also return an array to use a different selector
|
27
|
-
# type, like:
|
28
|
-
#
|
29
|
-
# when /the header/
|
30
|
-
# [:xpath, "//header"]
|
31
|
-
|
32
|
-
# This allows you to provide a quoted selector as the scope
|
33
|
-
# for "within" steps as was previously the default for the
|
34
|
-
# web steps:
|
35
|
-
when /^"(.+)"$/
|
36
|
-
$1
|
37
|
-
|
38
|
-
else
|
39
|
-
raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
|
40
|
-
"Now, go and add a mapping in #{__FILE__}"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
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,131 +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
|
-
Scenario: /^I should see "([^\"]*)" in the e?mail$/
|
13
|
-
When I go to "/emails/send_email"
|
14
|
-
Then the following step should succeed:
|
15
|
-
| I should see "BODY" in the email |
|
16
|
-
But the following step should fail:
|
17
|
-
| I should see "XYZ" in the email |
|
18
|
-
|
19
|
-
Scenario: /^(an|no) e?mail should have been sent with:$/
|
20
|
-
When I go to "/emails/send_email"
|
21
|
-
|
22
|
-
# Test without body
|
23
|
-
Then the following multiline step should succeed:
|
24
|
-
"""
|
25
|
-
Then an email should have been sent with:
|
26
|
-
'''
|
27
|
-
From: from@example.com
|
28
|
-
Reply-To: reply-to@example.com
|
29
|
-
To: to@example.com
|
30
|
-
Subject: SUBJECT
|
31
|
-
'''
|
32
|
-
"""
|
33
|
-
|
34
|
-
# Test with body
|
35
|
-
Then the following multiline step should succeed:
|
36
|
-
"""
|
37
|
-
Then an email should have been sent with:
|
38
|
-
'''
|
39
|
-
From: from@example.com
|
40
|
-
Reply-To: reply-to@example.com
|
41
|
-
To: to@example.com
|
42
|
-
Subject: SUBJECT
|
43
|
-
|
44
|
-
BODY
|
45
|
-
'''
|
46
|
-
"""
|
47
|
-
|
48
|
-
# Test with incorrect From header
|
49
|
-
Then the following multiline step should fail:
|
50
|
-
"""
|
51
|
-
Then an email should have been sent with:
|
52
|
-
'''
|
53
|
-
From: other-from@example.com
|
54
|
-
Reply-To: reply-to@example.com
|
55
|
-
To: to@example.com
|
56
|
-
Subject: SUBJECT
|
57
|
-
|
58
|
-
BODY
|
59
|
-
'''
|
60
|
-
"""
|
61
|
-
|
62
|
-
# Test with incorrect Reply-To header
|
63
|
-
Then the following multiline step should fail:
|
64
|
-
"""
|
65
|
-
Then an email should have been sent with:
|
66
|
-
'''
|
67
|
-
From: from@example.com
|
68
|
-
Reply-To: other-reply-to@example.com
|
69
|
-
To: to@example.com
|
70
|
-
Subject: SUBJECT
|
71
|
-
|
72
|
-
BODY
|
73
|
-
'''
|
74
|
-
"""
|
75
|
-
# Test with incorrect To header
|
76
|
-
Then the following multiline step should fail:
|
77
|
-
"""
|
78
|
-
Then an email should have been sent with:
|
79
|
-
'''
|
80
|
-
From: from@example.com
|
81
|
-
Reply-To: reply-to@example.com
|
82
|
-
To: other-to@example.com
|
83
|
-
Subject: SUBJECT
|
84
|
-
|
85
|
-
BODY
|
86
|
-
'''
|
87
|
-
"""
|
88
|
-
|
89
|
-
# Test with incorrect Subject header
|
90
|
-
Then the following multiline step should fail:
|
91
|
-
"""
|
92
|
-
Then an email should have been sent with:
|
93
|
-
'''
|
94
|
-
From: from@example.com
|
95
|
-
Reply-To: reply-to@example.com
|
96
|
-
To: to@example.com
|
97
|
-
Subject: OTHER-SUBJECT
|
98
|
-
|
99
|
-
BODY
|
100
|
-
'''
|
101
|
-
"""
|
102
|
-
|
103
|
-
# Test with incorrect body
|
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: SUBJECT
|
112
|
-
|
113
|
-
OTHER-BODY
|
114
|
-
'''
|
115
|
-
"""
|
116
|
-
|
117
|
-
# Test body with multiple paragraphs
|
118
|
-
Then the following multiline step should fail:
|
119
|
-
"""
|
120
|
-
Then an email should have been sent with:
|
121
|
-
'''
|
122
|
-
From: from@example.com
|
123
|
-
Reply-To: reply-to@example.com
|
124
|
-
To: to@example.com
|
125
|
-
Subject: SUBJECT
|
126
|
-
|
127
|
-
BODY
|
128
|
-
|
129
|
-
MORE-BODY
|
130
|
-
'''
|
131
|
-
"""
|
@@ -1,43 +0,0 @@
|
|
1
|
-
RSPEC_EXPECTATION_NOT_MET_ERROR = RSpec::Expectations::ExpectationNotMetError
|
2
|
-
|
3
|
-
Then /^the following steps? should (fail|succeed):$/ do |expectation, steps_table|
|
4
|
-
steps = steps_table.raw.flatten
|
5
|
-
|
6
|
-
steps.each do |step|
|
7
|
-
if expectation == 'fail'
|
8
|
-
expect { step(step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR)
|
9
|
-
|
10
|
-
else # succeed
|
11
|
-
step(step)
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
When /^I run the following steps?:$/ do |steps_table|
|
18
|
-
steps = steps_table.raw.flatten
|
19
|
-
|
20
|
-
steps.each do |step|
|
21
|
-
step(step)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
Then /^the following multiline step should (fail|succeed):$/ do |expectation, multiline_step|
|
26
|
-
multiline_step = multiline_step.gsub(%{'''}, %{"""})
|
27
|
-
if expectation == 'fail'
|
28
|
-
expect { steps(multiline_step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR)
|
29
|
-
else # succeed
|
30
|
-
steps(multiline_step)
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
Then(/^a hidden string with quotes should not be visible$/) do
|
36
|
-
hidden_string = %Q{hidden '" quotes}
|
37
|
-
assert_hidden(:text => hidden_string)
|
38
|
-
end
|
39
|
-
|
40
|
-
Then(/^a visible string with quotes should be visible$/) do
|
41
|
-
visible_string = %Q{visible '" quotes}
|
42
|
-
assert_visible(:text => visible_string)
|
43
|
-
end
|
@@ -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,46 +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 /^the timeline?$/
|
15
|
-
'.timeline'
|
16
|
-
|
17
|
-
when /^the table row containing "(.+?)"$/
|
18
|
-
all('tr').detect { |tr| tr.text.include? $1 } || raise("Could not find tr containing #{$1.inspect}")
|
19
|
-
|
20
|
-
# Add more mappings here.
|
21
|
-
# Here is an example that pulls values out of the Regexp:
|
22
|
-
#
|
23
|
-
# when /^the (notice|error|info) flash$/
|
24
|
-
# ".flash.#{$1}"
|
25
|
-
|
26
|
-
# You can also return an array to use a different selector
|
27
|
-
# type, like:
|
28
|
-
#
|
29
|
-
# when /the header/
|
30
|
-
# [:xpath, "//header"]
|
31
|
-
|
32
|
-
# This allows you to provide a quoted selector as the scope
|
33
|
-
# for "within" steps as was previously the default for the
|
34
|
-
# web steps:
|
35
|
-
when /^"(.+)"$/
|
36
|
-
$1
|
37
|
-
|
38
|
-
else
|
39
|
-
raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
|
40
|
-
"Now, go and add a mapping in #{__FILE__}"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
World(HtmlSelectorsHelpers)
|
@@ -1,292 +0,0 @@
|
|
1
|
-
Feature: Table steps
|
2
|
-
|
3
|
-
|
4
|
-
Scenario: should see a table with the following rows
|
5
|
-
When I go to "/tables/table1"
|
6
|
-
Then the following multiline step should succeed:
|
7
|
-
"""
|
8
|
-
Then I should see a table with the following rows:
|
9
|
-
| 1-1 | 1-2 | 1-3 |
|
10
|
-
| 2-1 | 2-2 | 2-3 |
|
11
|
-
| 3-1 | 3-2 | 3-3 |
|
12
|
-
"""
|
13
|
-
And the following multiline step should succeed:
|
14
|
-
"""
|
15
|
-
Then I should see a table with the following rows:
|
16
|
-
| 1-1 | 1-3 |
|
17
|
-
| 2-1 | 2-3 |
|
18
|
-
| 3-1 | 3-3 |
|
19
|
-
"""
|
20
|
-
And the following multiline step should succeed:
|
21
|
-
"""
|
22
|
-
Then I should see a table with the following rows:
|
23
|
-
| 1-2 | 1-3 |
|
24
|
-
| 2-2 | 2-3 |
|
25
|
-
| 3-2 | 3-3 |
|
26
|
-
"""
|
27
|
-
And the following multiline step should succeed:
|
28
|
-
"""
|
29
|
-
Then I should see a table with the following rows:
|
30
|
-
| 1-1 | 1-2 | 1-3 |
|
31
|
-
| 3-1 | 3-2 | 3-3 |
|
32
|
-
"""
|
33
|
-
And the following multiline step should succeed:
|
34
|
-
"""
|
35
|
-
Then I should see a table with the following rows:
|
36
|
-
| 2-1 | 2-2 | 2-3 |
|
37
|
-
| 3-1 | 3-2 | 3-3 |
|
38
|
-
"""
|
39
|
-
And the following multiline step should succeed:
|
40
|
-
"""
|
41
|
-
Then I should see a table with the following rows:
|
42
|
-
| 1-1 | 1-2 | 1-3 |
|
43
|
-
| 2-1 | 2-2 | 2-3 |
|
44
|
-
"""
|
45
|
-
And the following multiline step should succeed:
|
46
|
-
"""
|
47
|
-
Then I should see a table with the following rows:
|
48
|
-
| 1-1 | 1-3 |
|
49
|
-
| 3-1 | 3-3 |
|
50
|
-
"""
|
51
|
-
And the following multiline step should succeed:
|
52
|
-
"""
|
53
|
-
Then I should see a table with the following rows:
|
54
|
-
| 1* | 1-3 |
|
55
|
-
| 3* | 3-3 |
|
56
|
-
"""
|
57
|
-
And the following multiline step should fail:
|
58
|
-
"""
|
59
|
-
Then I should see a table with the following rows:
|
60
|
-
| 3-1 | 3-2 | 3-3 |
|
61
|
-
| 1-1 | 1-2 | 1-3 |
|
62
|
-
| 2-1 | 2-2 | 2-3 |
|
63
|
-
"""
|
64
|
-
But the following multiline step should fail:
|
65
|
-
"""
|
66
|
-
Then I should see a table with the following rows:
|
67
|
-
| 1-1 | 1-2 | 1-3 |
|
68
|
-
| 2-1 | 2-2 | 2-3 |
|
69
|
-
| 3-1 | 3-2 | foo |
|
70
|
-
"""
|
71
|
-
And the following multiline step should fail:
|
72
|
-
"""
|
73
|
-
Then I should see a table with the following rows:
|
74
|
-
| 1-1 | 1-2 | 1-3 |
|
75
|
-
| 2-1 | foo | 2-3 |
|
76
|
-
| 3-1 | 3-2 | 3-3 |
|
77
|
-
"""
|
78
|
-
And the following multiline step should fail:
|
79
|
-
"""
|
80
|
-
Then I should see a table with the following rows:
|
81
|
-
| 1 | 1-3 |
|
82
|
-
| 3 | 3-3 |
|
83
|
-
"""
|
84
|
-
|
85
|
-
|
86
|
-
Scenario: Cell content normalization
|
87
|
-
When I go to "/tables/table_with_weird_spaces"
|
88
|
-
Then I should see a table with the following rows:
|
89
|
-
| one two | three four |
|
90
|
-
| five six | seven eight |
|
91
|
-
| nineten | eleventwelve |
|
92
|
-
|
93
|
-
|
94
|
-
Scenario: should not see a table with the following rows
|
95
|
-
When I go to "/tables/table1"
|
96
|
-
Then the following multiline step should fail:
|
97
|
-
"""
|
98
|
-
Then I should not see a table with the following rows:
|
99
|
-
| 1-1 | 1-2 | 1-3 |
|
100
|
-
| 2-1 | 2-2 | 2-3 |
|
101
|
-
| 3-1 | 3-2 | 3-3 |
|
102
|
-
"""
|
103
|
-
But the following multiline step should succeed:
|
104
|
-
"""
|
105
|
-
Then I should not see a table with the following rows:
|
106
|
-
| 3-1 | 3-2 | 3-3 |
|
107
|
-
| 1-1 | 1-2 | 1-3 |
|
108
|
-
| 2-1 | 2-2 | 2-3 |
|
109
|
-
"""
|
110
|
-
|
111
|
-
|
112
|
-
Scenario: should see a table with exactly the following rows
|
113
|
-
When I go to "/tables/table1"
|
114
|
-
Then the following multiline step should succeed:
|
115
|
-
"""
|
116
|
-
Then I should see a table with exactly the following rows:
|
117
|
-
| 1-1 | 1-2 | 1-3 |
|
118
|
-
| 2-1 | 2-2 | 2-3 |
|
119
|
-
| 3-1 | 3-2 | 3-3 |
|
120
|
-
"""
|
121
|
-
And the following multiline step should succeed:
|
122
|
-
"""
|
123
|
-
Then I should see a table with exactly the following rows:
|
124
|
-
| 1-1 | 1-3 |
|
125
|
-
| 2-1 | 2-3 |
|
126
|
-
| 3-1 | 3-3 |
|
127
|
-
"""
|
128
|
-
But the following multiline step should fail:
|
129
|
-
"""
|
130
|
-
Then I should see a table with exactly the following rows:
|
131
|
-
| 2-1 | 2-2 | 2-3 |
|
132
|
-
| 1-1 | 1-2 | 1-3 |
|
133
|
-
| 3-1 | 3-2 | 3-3 |
|
134
|
-
"""
|
135
|
-
And the following multiline step should fail:
|
136
|
-
"""
|
137
|
-
Then I should see a table with exactly the following rows:
|
138
|
-
| 1-1 | 1-2 | 1-3 |
|
139
|
-
| 3-1 | 3-2 | 3-3 |
|
140
|
-
"""
|
141
|
-
|
142
|
-
Scenario: should not see a table with exactly the following rows
|
143
|
-
When I go to "/tables/table1"
|
144
|
-
Then the following multiline step should fail:
|
145
|
-
"""
|
146
|
-
Then I should not see a table with exactly the following rows:
|
147
|
-
| 1-1 | 1-2 | 1-3 |
|
148
|
-
| 2-1 | 2-2 | 2-3 |
|
149
|
-
| 3-1 | 3-2 | 3-3 |
|
150
|
-
"""
|
151
|
-
And the following multiline step should fail:
|
152
|
-
"""
|
153
|
-
Then I should not see a table with exactly the following rows:
|
154
|
-
| 1-1 | 1-3 |
|
155
|
-
| 2-1 | 2-3 |
|
156
|
-
| 3-1 | 3-3 |
|
157
|
-
"""
|
158
|
-
But the following multiline step should succeed:
|
159
|
-
"""
|
160
|
-
Then I should not see a table with exactly the following rows:
|
161
|
-
| 2-1 | 2-2 | 2-3 |
|
162
|
-
| 1-1 | 1-2 | 1-3 |
|
163
|
-
| 3-1 | 3-2 | 3-3 |
|
164
|
-
"""
|
165
|
-
And the following multiline step should succeed:
|
166
|
-
"""
|
167
|
-
Then I should not see a table with exactly the following rows:
|
168
|
-
| 1-1 | 1-2 | 1-3 |
|
169
|
-
| 3-1 | 3-2 | 3-3 |
|
170
|
-
"""
|
171
|
-
|
172
|
-
|
173
|
-
Scenario: should see a table with the following rows in any order
|
174
|
-
When I go to "/tables/table1"
|
175
|
-
Then the following multiline step should succeed:
|
176
|
-
"""
|
177
|
-
Then I should see a table with the following rows in any order:
|
178
|
-
| 1-1 | 1-2 | 1-3 |
|
179
|
-
| 2-1 | 2-2 | 2-3 |
|
180
|
-
| 3-1 | 3-2 | 3-3 |
|
181
|
-
"""
|
182
|
-
And the following multiline step should succeed:
|
183
|
-
"""
|
184
|
-
Then I should see a table with the following rows in any order:
|
185
|
-
| 1-1 | 1-2 | 1-3 |
|
186
|
-
| 3-1 | 3-2 | 3-3 |
|
187
|
-
"""
|
188
|
-
And the following multiline step should succeed:
|
189
|
-
"""
|
190
|
-
Then I should see a table with the following rows in any order:
|
191
|
-
| 3-1 | 3-2 | 3-3 |
|
192
|
-
| 1-1 | 1-2 | 1-3 |
|
193
|
-
| 2-1 | 2-2 | 2-3 |
|
194
|
-
"""
|
195
|
-
But the following multiline step should fail:
|
196
|
-
"""
|
197
|
-
Then I should see a table with the following rows in any order:
|
198
|
-
| 1-1 | 1-2 | 1-3 |
|
199
|
-
| 2-1 | 2-2 | 2-3 |
|
200
|
-
| 3-1 | 3-2 | foo |
|
201
|
-
"""
|
202
|
-
And the following multiline step should fail:
|
203
|
-
"""
|
204
|
-
Then I should see a table with the following rows in any order:
|
205
|
-
| 1 | 1-3 |
|
206
|
-
| 3 | 3-3 |
|
207
|
-
"""
|
208
|
-
|
209
|
-
|
210
|
-
Scenario: should not see a table with the following rows in any order
|
211
|
-
When I go to "/tables/table1"
|
212
|
-
Then the following multiline step should fail:
|
213
|
-
"""
|
214
|
-
Then I should not see a table with the following rows in any order:
|
215
|
-
| 1-1 | 1-2 | 1-3 |
|
216
|
-
| 2-1 | 2-2 | 2-3 |
|
217
|
-
| 3-1 | 3-2 | 3-3 |
|
218
|
-
"""
|
219
|
-
And the following multiline step should fail:
|
220
|
-
"""
|
221
|
-
Then I should not see a table with the following rows in any order:
|
222
|
-
| 1-1 | 1-2 | 1-3 |
|
223
|
-
| 3-1 | 3-2 | 3-3 |
|
224
|
-
"""
|
225
|
-
And the following multiline step should fail:
|
226
|
-
"""
|
227
|
-
Then I should not see a table with the following rows in any order:
|
228
|
-
| 3-1 | 3-2 | 3-3 |
|
229
|
-
| 1-1 | 1-2 | 1-3 |
|
230
|
-
| 2-1 | 2-2 | 2-3 |
|
231
|
-
"""
|
232
|
-
But the following multiline step should succeed:
|
233
|
-
"""
|
234
|
-
Then I should not see a table with the following rows in any order:
|
235
|
-
| 1-1 | 1-2 | 1-3 |
|
236
|
-
| 2-1 | 2-2 | 2-3 |
|
237
|
-
| 3-1 | 3-2 | foo |
|
238
|
-
"""
|
239
|
-
And the following multiline step should succeed:
|
240
|
-
"""
|
241
|
-
Then I should not see a table with the following rows in any order:
|
242
|
-
| 1 | 1-3 |
|
243
|
-
| 3 | 3-3 |
|
244
|
-
"""
|
245
|
-
|
246
|
-
|
247
|
-
Scenario: should see a table with exactly the following rows in any order
|
248
|
-
When I go to "/tables/table1"
|
249
|
-
Then the following multiline step should succeed:
|
250
|
-
"""
|
251
|
-
Then I should see a table with exactly the following rows in any order:
|
252
|
-
| 1-1 | 1-2 | 1-3 |
|
253
|
-
| 2-1 | 2-2 | 2-3 |
|
254
|
-
| 3-1 | 3-2 | 3-3 |
|
255
|
-
"""
|
256
|
-
And the following multiline step should succeed:
|
257
|
-
"""
|
258
|
-
Then I should see a table with exactly the following rows in any order:
|
259
|
-
| 3-1 | 3-2 | 3-3 |
|
260
|
-
| 1-1 | 1-2 | 1-3 |
|
261
|
-
| 2-1 | 2-2 | 2-3 |
|
262
|
-
"""
|
263
|
-
But the following multiline step should fail:
|
264
|
-
"""
|
265
|
-
Then I should see a table with exactly the following rows in any order:
|
266
|
-
| 1-1 | 1-2 | 1-3 |
|
267
|
-
| 3-1 | 3-2 | 3-3 |
|
268
|
-
"""
|
269
|
-
|
270
|
-
|
271
|
-
Scenario: should not see a table with exactly the following rows in any order
|
272
|
-
When I go to "/tables/table1"
|
273
|
-
Then the following multiline step should fail:
|
274
|
-
"""
|
275
|
-
Then I should not see a table with exactly the following rows in any order:
|
276
|
-
| 1-1 | 1-2 | 1-3 |
|
277
|
-
| 2-1 | 2-2 | 2-3 |
|
278
|
-
| 3-1 | 3-2 | 3-3 |
|
279
|
-
"""
|
280
|
-
And the following multiline step should fail:
|
281
|
-
"""
|
282
|
-
Then I should not see a table with exactly the following rows in any order:
|
283
|
-
| 3-1 | 3-2 | 3-3 |
|
284
|
-
| 1-1 | 1-2 | 1-3 |
|
285
|
-
| 2-1 | 2-2 | 2-3 |
|
286
|
-
"""
|
287
|
-
But the following multiline step should succeed:
|
288
|
-
"""
|
289
|
-
Then I should not see a table with exactly the following rows in any order:
|
290
|
-
| 1-1 | 1-2 | 1-3 |
|
291
|
-
| 3-1 | 3-2 | 3-3 |
|
292
|
-
"""
|
@@ -1,152 +0,0 @@
|
|
1
|
-
Feature: Web steps
|
2
|
-
|
3
|
-
Scenario: /^the "([^"]*)" field should (not )?contain "([^"]*)"$/
|
4
|
-
When I go to "/forms/form1"
|
5
|
-
Then the "Text control" field should contain "Text control value"
|
6
|
-
Then the "Select control" field should contain "Label 2"
|
7
|
-
Then the "Select control without selection" field should contain "Label 1"
|
8
|
-
Then the "Textarea control" field should contain "Textarea control value"
|
9
|
-
Then the "Empty control" field should contain ""
|
10
|
-
|
11
|
-
Scenario: /^the "([^"]*)" field should (not )?contain:/
|
12
|
-
When I go to "/forms/form2"
|
13
|
-
Then the "Text control" field should contain:
|
14
|
-
"""
|
15
|
-
Text control value
|
16
|
-
"""
|
17
|
-
Then the "Textarea control" field should contain:
|
18
|
-
"""
|
19
|
-
Textarea control line 1
|
20
|
-
Textarea control line 2
|
21
|
-
"""
|
22
|
-
Then the "Empty textarea control" field should contain:
|
23
|
-
"""
|
24
|
-
"""
|
25
|
-
|
26
|
-
Scenario: /^I should see a form with the following values:$/
|
27
|
-
When I go to "/forms/form1"
|
28
|
-
Then I should see a form with the following values:
|
29
|
-
| Text control | Text control value |
|
30
|
-
| Select control | Label 2 |
|
31
|
-
| Select control without selection | Label 1 |
|
32
|
-
| Textarea control | Textarea control value |
|
33
|
-
| Empty control | |
|
34
|
-
|
35
|
-
|
36
|
-
Scenario: /^"([^"]*)" should( not)? be selected for "([^"]*)"$/
|
37
|
-
When I go to "/forms/form1"
|
38
|
-
Then "Label 2" should be selected for "Select control"
|
39
|
-
But "Label 1" should not be selected for "Select control"
|
40
|
-
And "Label 1" should be selected for "Select control without selection"
|
41
|
-
|
42
|
-
|
43
|
-
Scenario: /^nothing should be selected for "([^"]*)"$/
|
44
|
-
When I go to "/forms/form1"
|
45
|
-
Then nothing should be selected for "Select control with blank option"
|
46
|
-
Then nothing should be selected for "Select control with blank selection"
|
47
|
-
|
48
|
-
|
49
|
-
Scenario: /^I go back$/
|
50
|
-
Given I go to "/static_pages/link_to_home"
|
51
|
-
And I follow "Home"
|
52
|
-
|
53
|
-
When I go back
|
54
|
-
Then I should be on "/static_pages/link_to_home"
|
55
|
-
|
56
|
-
|
57
|
-
Scenario: /^the "([^"]*)" checkbox should( not)? be checked$/
|
58
|
-
When I go to "/forms/checkbox_form"
|
59
|
-
Then the "Checked" checkbox should be checked
|
60
|
-
And the "Unchecked" checkbox should not be checked
|
61
|
-
|
62
|
-
|
63
|
-
@javascript
|
64
|
-
Scenario: /^I click on "([^\"]+)"$/
|
65
|
-
When I go to "/static_pages/click_on"
|
66
|
-
And I click on "Nested"
|
67
|
-
# See that it clicks the innermost element with that text
|
68
|
-
Then I should see "You clicked on .inner"
|
69
|
-
When I click on "Button"
|
70
|
-
Then I should see "You clicked on .button"
|
71
|
-
|
72
|
-
@javascript
|
73
|
-
Scenario: /^I click on the element "([^\"]+)"$/
|
74
|
-
When I go to "/static_pages/click_on"
|
75
|
-
And I click on the element ".inner"
|
76
|
-
Then I should see "You clicked on .inner"
|
77
|
-
When I click on the element ".button"
|
78
|
-
Then I should see "You clicked on .button"
|
79
|
-
|
80
|
-
@javascript
|
81
|
-
Scenario: /^I click on the element for .*?$/
|
82
|
-
When I go to "/static_pages/click_on"
|
83
|
-
And I click on the element for a panel
|
84
|
-
Then I should see "You clicked on .panel"
|
85
|
-
When I click on the element for the timeline
|
86
|
-
Then I should see "You clicked on .timeline"
|
87
|
-
|
88
|
-
Scenario: /^the "(.*?)" select should( not)? be sorted$/
|
89
|
-
When I go to "/forms/select_fields"
|
90
|
-
Then the "sorted" select should be sorted
|
91
|
-
But the "unsorted" select should not be sorted
|
92
|
-
|
93
|
-
|
94
|
-
Scenario: /^Then (the tag )?"..." should( not)? be visible$/
|
95
|
-
When I go to "/static_pages/visibility"
|
96
|
-
Then "hidden ümläüt" should not be visible
|
97
|
-
And "visible ümläüt" should be visible
|
98
|
-
And a hidden string with quotes should not be visible
|
99
|
-
And a visible string with quotes should be visible
|
100
|
-
And "hidden ümläüt" should be hidden
|
101
|
-
|
102
|
-
@javascript
|
103
|
-
Scenario: /^Then (the tag )?"..." should( not)? be visible$/ with javascript
|
104
|
-
When I go to "/static_pages/visibility"
|
105
|
-
Then "hidden ümläüt" should not be visible
|
106
|
-
And "visible ümläüt" should be visible
|
107
|
-
And a hidden string with quotes should not be visible
|
108
|
-
And a visible string with quotes should be visible
|
109
|
-
And "hidden ümläüt" should be hidden
|
110
|
-
|
111
|
-
Scenario: /^the "([^\"]*)" field should( not)? be visible$/
|
112
|
-
When I go to "/static_pages/visibility"
|
113
|
-
Then the "Visible field" field should be visible
|
114
|
-
But the "Hidden field" field should not be visible
|
115
|
-
|
116
|
-
@javascript
|
117
|
-
Scenario: /^the "([^\"]*)" field should( not)? be visible$/ with Javascript
|
118
|
-
When I go to "/static_pages/visibility"
|
119
|
-
Then the "Visible field" field should be visible
|
120
|
-
But the "Hidden field" field should not be visible
|
121
|
-
|
122
|
-
Scenario: /^I should (not )?see (?:|a|an |the )(.*?) element$/
|
123
|
-
When I go to "/static_pages/see_element"
|
124
|
-
Then I should see an element ".panel"
|
125
|
-
And I should see the element ".panel"
|
126
|
-
And I should see an element for a panel
|
127
|
-
And I should see the element for a panel
|
128
|
-
But I should not see an element ".timeline"
|
129
|
-
But I should not see the element ".timeline"
|
130
|
-
And I should not see an element for the timeline
|
131
|
-
And I should not see the element for the timeline
|
132
|
-
|
133
|
-
Scenario: /^(.*) within (.*[^:])$/
|
134
|
-
When I go to "/static_pages/within"
|
135
|
-
Then I should see an element ".child1" within ".container1"
|
136
|
-
But I should not see an element ".child1" within ".container2"
|
137
|
-
|
138
|
-
Scenario: /^(.*) within (.*[^:])$/ with a Capybara::Node::Element
|
139
|
-
When I go to "/static_pages/within"
|
140
|
-
Then I should see "All" within the table row containing "Admin"
|
141
|
-
|
142
|
-
Scenario: /^I perform basic authentication as "([^\"]*)\/([^\"]*)" and go to (.*)$/
|
143
|
-
When I go to "/authenticated/page"
|
144
|
-
Then I should see "Access denied"
|
145
|
-
When I perform basic authentication as "user/password" and go to "/authenticated/page"
|
146
|
-
Then I should see "Action reached"
|
147
|
-
|
148
|
-
@javascript
|
149
|
-
Scenario: /^I perform basic authentication as "([^\"]*)\/([^\"]*)" and go to (.*)$/ with Javascript
|
150
|
-
When I perform basic authentication as "user/password" and go to "/authenticated/page"
|
151
|
-
Then I should see "Action reached"
|
152
|
-
|