spreewald 4.1.1 → 4.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +0 -5
  3. data/CHANGELOG.md +16 -0
  4. data/Gemfile.lock +3 -3
  5. data/Gemfile.ruby266.lock +59 -42
  6. data/Gemfile.ruby300.lock +37 -53
  7. data/README.md +10 -19
  8. data/Rakefile +5 -11
  9. data/examples/paths.rb +7 -0
  10. data/features/binary.feature +12 -8
  11. data/lib/spreewald/development_steps.rb +5 -5
  12. data/lib/spreewald/email_steps.rb +4 -18
  13. data/lib/spreewald/web_steps.rb +53 -50
  14. data/lib/spreewald.rb +1 -0
  15. data/lib/spreewald_support/field_errors.rb +56 -0
  16. data/lib/spreewald_support/version.rb +1 -1
  17. data/lib/steps/follow_the_link.rb +63 -0
  18. data/lib/steps/show_me_the_mails.rb +20 -0
  19. data/spec/steps/follow_the_link_spec.rb +81 -0
  20. data/spec/steps/show_me_the_mails_spec.rb +96 -0
  21. data/support/step_definition.rb +11 -0
  22. data/support/step_manager.rb +1 -1
  23. data/tests/rails-6_capybara-3/Gemfile.lock +1 -1
  24. data/tests/shared/app/controllers/forms_controller.rb +8 -2
  25. data/tests/shared/app/controllers/static_pages_controller.rb +3 -0
  26. data/tests/shared/app/views/forms/invalid_bootstrap3_form.html.haml +16 -0
  27. data/tests/shared/app/views/forms/invalid_bootstrap4_form.html.haml +18 -0
  28. data/tests/shared/app/views/forms/{invalid_form.html.haml → invalid_rails_form.html.haml} +0 -0
  29. data/tests/shared/app/views/static_pages/should_see.haml +7 -0
  30. data/tests/shared/config/routes.rb +4 -1
  31. data/tests/shared/features/shared/iframe_steps.feature +1 -2
  32. data/tests/shared/features/shared/web_steps.feature +47 -15
  33. metadata +15 -112
  34. data/Gemfile.ruby245 +0 -10
  35. data/Gemfile.ruby245.lock +0 -73
  36. data/tests/rails-4_capybara-2/Gemfile +0 -24
  37. data/tests/rails-4_capybara-2/Gemfile.lock +0 -230
  38. data/tests/rails-4_capybara-2/README.rdoc +0 -28
  39. data/tests/rails-4_capybara-2/Rakefile +0 -6
  40. data/tests/rails-4_capybara-2/app +0 -1
  41. data/tests/rails-4_capybara-2/bin/bundle +0 -3
  42. data/tests/rails-4_capybara-2/bin/rails +0 -4
  43. data/tests/rails-4_capybara-2/bin/rake +0 -4
  44. data/tests/rails-4_capybara-2/bin/setup +0 -29
  45. data/tests/rails-4_capybara-2/config/application.rb +0 -35
  46. data/tests/rails-4_capybara-2/config/boot.rb +0 -3
  47. data/tests/rails-4_capybara-2/config/cucumber.yml +0 -8
  48. data/tests/rails-4_capybara-2/config/database.yml +0 -18
  49. data/tests/rails-4_capybara-2/config/environment.rb +0 -5
  50. data/tests/rails-4_capybara-2/config/environments/development.rb +0 -28
  51. data/tests/rails-4_capybara-2/config/environments/test.rb +0 -42
  52. data/tests/rails-4_capybara-2/config/initializers/backtrace_silencers.rb +0 -7
  53. data/tests/rails-4_capybara-2/config/initializers/cookies_serializer.rb +0 -3
  54. data/tests/rails-4_capybara-2/config/initializers/filter_parameter_logging.rb +0 -4
  55. data/tests/rails-4_capybara-2/config/initializers/inflections.rb +0 -16
  56. data/tests/rails-4_capybara-2/config/initializers/mime_types.rb +0 -4
  57. data/tests/rails-4_capybara-2/config/initializers/session_store.rb +0 -3
  58. data/tests/rails-4_capybara-2/config/initializers/silence_deprecation_warnings.rb +0 -11
  59. data/tests/rails-4_capybara-2/config/initializers/to_time_preserves_timezone.rb +0 -10
  60. data/tests/rails-4_capybara-2/config/initializers/wrap_parameters.rb +0 -14
  61. data/tests/rails-4_capybara-2/config/locales/en.yml +0 -23
  62. data/tests/rails-4_capybara-2/config/routes.rb +0 -1
  63. data/tests/rails-4_capybara-2/config/secrets.yml +0 -22
  64. data/tests/rails-4_capybara-2/config.ru +0 -4
  65. data/tests/rails-4_capybara-2/db +0 -1
  66. data/tests/rails-4_capybara-2/features/browser_tab_steps.feature +0 -1
  67. data/tests/rails-4_capybara-2/features/development_steps.feature +0 -1
  68. data/tests/rails-4_capybara-2/features/email_steps.feature +0 -1
  69. data/tests/rails-4_capybara-2/features/iframe_steps.feature +0 -1
  70. data/tests/rails-4_capybara-2/features/overriding.feature +0 -1
  71. data/tests/rails-4_capybara-2/features/session_steps.feature +0 -1
  72. data/tests/rails-4_capybara-2/features/step_definitions/overriding_steps.rb +0 -1
  73. data/tests/rails-4_capybara-2/features/step_definitions/test_steps.rb +0 -1
  74. data/tests/rails-4_capybara-2/features/support/env.rb +0 -66
  75. data/tests/rails-4_capybara-2/features/support/paths.rb +0 -1
  76. data/tests/rails-4_capybara-2/features/support/selectors.rb +0 -1
  77. data/tests/rails-4_capybara-2/features/support/selenium.rb +0 -1
  78. data/tests/rails-4_capybara-2/features/table_steps.feature +0 -1
  79. data/tests/rails-4_capybara-2/features/time_steps.feature +0 -1
  80. data/tests/rails-4_capybara-2/features/web_steps.feature +0 -1
  81. data/tests/rails-4_capybara-2/lib/tasks/cucumber.rake +0 -65
  82. data/tests/rails-4_capybara-2/log/.keep +0 -0
  83. data/tests/rails-4_capybara-2/public/404.html +0 -67
  84. data/tests/rails-4_capybara-2/public/422.html +0 -67
  85. data/tests/rails-4_capybara-2/public/500.html +0 -66
  86. data/tests/rails-4_capybara-2/public/favicon.ico +0 -0
  87. data/tests/rails-4_capybara-2/public/fixture_files +0 -1
  88. data/tests/rails-4_capybara-2/script/cucumber +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06fe5aa45812c755a6f7b875be6fd48a9c17e134a059aaec4f18d7777f4e88ca
4
- data.tar.gz: 5612118b301015088b9b9702aaf77d5b1e140ae03e785d2ad840c7bc5805c3d8
3
+ metadata.gz: e10c60e2e7cc0636a4cfa38bcd509de5f6e1d1077e796b0e80bfb59eae84f9a3
4
+ data.tar.gz: 9543765c53174dfab02096267b5ff9c5498a555d730b3a9a0d95b6b10a78b40a
5
5
  SHA512:
6
- metadata.gz: 39507ac68849f59b244bfe7555654aba0b8371d62fdfbb70dcf186713b2458b300a47a05c66c3f6b78183d35313914df60c2b2197ec0ba688f1b82d01fec34cd
7
- data.tar.gz: a6f5033b9f9d952c7fed05fd38ec6a2e6b72c6ad1e7eadae2311491ff0342ce84afe60015ec81b950a4b04fbe01597e277deec95a929da32b2eadaf4e5f5c4c3
6
+ metadata.gz: b1189c2293c12c110640dcae56c73a2ccebf395d0fcf52d39ed50180e045da393fef78485602b303fd6882a268424ed5d16fd27ce1936551d1efb352f6e8869d
7
+ data.tar.gz: '08050f1748090f777465abf05636b0479375d5043f0d08865b07011e20fcddadb3b60c67574dd7c05895d54539a539bc213dfbac1decac949b7b8a83f439d8e5'
@@ -14,14 +14,9 @@ jobs:
14
14
  fail-fast: false
15
15
  matrix:
16
16
  include:
17
- # Test projects
18
- - ruby: 2.4.5
19
- gemfile: tests/rails-4_capybara-2/Gemfile
20
17
  - ruby: 3.0.0
21
18
  gemfile: tests/rails-6_capybara-3/Gemfile
22
19
  # Used to run rspec and integration tests for spreewald binary:
23
- - ruby: 2.4.5
24
- gemfile: Gemfile.ruby245
25
20
  - ruby: 2.6.6
26
21
  gemfile: Gemfile.ruby266
27
22
  - ruby: 3.0.0
data/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## 4.3.2
7
+ - Added built-in support for Rails and Bootstrap (3-5) error classes to the steps
8
+ - `The ... field should have the error ...`
9
+ - `The ... field should have an error`
10
+ - Added the possibility to specify custom error classes and message selectors for these steps
11
+ using `Spreewald.field_error_class` and `Spreewald.error_message_xpath_selector` in your configuration.
12
+
13
+ ## 4.2.2
14
+ - Fixes the "Show me the email" step (#171)
15
+ - Fixes the "I follow the link in the email" step. (#172, #173)
16
+ - It works for emails with and without explicit html parts
17
+ - There's a better error message if no links are found
18
+
19
+ ## 4.1.2
20
+ - Multiple invocations of console don't raise anymore
21
+
6
22
  ## 4.1.1
7
23
  - The step `I open .. in a new browser tab` is now using the `noopener` option (see issue [#174])
8
24
 
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- gemika (0.5.0)
5
- rake (12.3.2)
4
+ gemika (0.6.1)
5
+ rake (13.0.3)
6
6
 
7
7
  PLATFORMS
8
8
  ruby
@@ -12,4 +12,4 @@ DEPENDENCIES
12
12
  rake
13
13
 
14
14
  BUNDLED WITH
15
- 2.2.3
15
+ 2.2.17
data/Gemfile.ruby266.lock CHANGED
@@ -1,60 +1,77 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- aruba (1.0.0)
5
- childprocess (~> 3.0)
6
- contracts (~> 0.16.0)
7
- cucumber (>= 2.4, < 4.0)
8
- ffi (~> 1.9)
4
+ aruba (2.0.0)
5
+ bundler (>= 1.17, < 3.0)
6
+ childprocess (>= 2.0, < 5.0)
7
+ contracts (>= 0.16.0, < 0.18.0)
8
+ cucumber (>= 4.0, < 8.0)
9
9
  rspec-expectations (~> 3.4)
10
10
  thor (~> 1.0)
11
- backports (3.17.0)
12
11
  builder (3.2.4)
13
- childprocess (3.0.0)
12
+ childprocess (4.0.0)
14
13
  contracts (0.16.0)
15
- cucumber (3.1.2)
16
- builder (>= 2.1.2)
17
- cucumber-core (~> 3.2.0)
18
- cucumber-expressions (~> 6.0.1)
19
- cucumber-wire (~> 0.0.1)
20
- diff-lcs (~> 1.3)
21
- gherkin (~> 5.1.0)
22
- multi_json (>= 1.7.5, < 2.0)
23
- multi_test (>= 0.1.2)
24
- cucumber-core (3.2.1)
25
- backports (>= 3.8.0)
26
- cucumber-tag_expressions (~> 1.1.0)
27
- gherkin (~> 5.0)
28
- cucumber-expressions (6.0.1)
29
- cucumber-tag_expressions (1.1.1)
30
- cucumber-wire (0.0.1)
31
- diff-lcs (1.3)
32
- ffi (1.12.2)
33
- gemika (0.5.0)
34
- gherkin (5.1.0)
14
+ cucumber (7.1.0)
15
+ builder (~> 3.2, >= 3.2.4)
16
+ cucumber-core (~> 10.1, >= 10.1.0)
17
+ cucumber-create-meta (~> 6.0, >= 6.0.1)
18
+ cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
19
+ cucumber-gherkin (~> 22.0, >= 22.0.0)
20
+ cucumber-html-formatter (~> 17.0, >= 17.0.0)
21
+ cucumber-messages (~> 17.1, >= 17.1.1)
22
+ cucumber-wire (~> 6.2, >= 6.2.0)
23
+ diff-lcs (~> 1.4, >= 1.4.4)
24
+ mime-types (~> 3.3, >= 3.3.1)
25
+ multi_test (~> 0.1, >= 0.1.2)
26
+ sys-uname (~> 1.2, >= 1.2.2)
27
+ cucumber-core (10.1.0)
28
+ cucumber-gherkin (~> 22.0, >= 22.0.0)
29
+ cucumber-messages (~> 17.1, >= 17.1.1)
30
+ cucumber-tag-expressions (~> 4.0, >= 4.0.2)
31
+ cucumber-create-meta (6.0.4)
32
+ cucumber-messages (~> 17.1, >= 17.1.1)
33
+ sys-uname (~> 1.2, >= 1.2.2)
34
+ cucumber-cucumber-expressions (14.0.0)
35
+ cucumber-gherkin (22.0.0)
36
+ cucumber-messages (~> 17.1, >= 17.1.1)
37
+ cucumber-html-formatter (17.0.0)
38
+ cucumber-messages (~> 17.1, >= 17.1.0)
39
+ cucumber-messages (17.1.1)
40
+ cucumber-tag-expressions (4.1.0)
41
+ cucumber-wire (6.2.0)
42
+ cucumber-core (~> 10.1, >= 10.1.0)
43
+ cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
44
+ cucumber-messages (~> 17.1, >= 17.1.1)
45
+ diff-lcs (1.4.4)
46
+ ffi (1.15.4)
47
+ gemika (0.6.1)
35
48
  mail (2.7.1)
36
49
  mini_mime (>= 0.1.1)
37
- mini_mime (1.0.2)
38
- multi_json (1.14.1)
50
+ mime-types (3.4.1)
51
+ mime-types-data (~> 3.2015)
52
+ mime-types-data (3.2021.1115)
53
+ mini_mime (1.1.2)
39
54
  multi_test (0.1.2)
40
55
  nokogiri (1.11.1-x86_64-linux)
41
56
  racc (~> 1.4)
42
57
  racc (1.5.2)
43
58
  rake (13.0.3)
44
- rspec (3.9.0)
45
- rspec-core (~> 3.9.0)
46
- rspec-expectations (~> 3.9.0)
47
- rspec-mocks (~> 3.9.0)
48
- rspec-core (3.9.1)
49
- rspec-support (~> 3.9.1)
50
- rspec-expectations (3.9.1)
59
+ rspec (3.10.0)
60
+ rspec-core (~> 3.10.0)
61
+ rspec-expectations (~> 3.10.0)
62
+ rspec-mocks (~> 3.10.0)
63
+ rspec-core (3.10.1)
64
+ rspec-support (~> 3.10.0)
65
+ rspec-expectations (3.10.1)
51
66
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.9.0)
53
- rspec-mocks (3.9.1)
67
+ rspec-support (~> 3.10.0)
68
+ rspec-mocks (3.10.2)
54
69
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.9.0)
56
- rspec-support (3.9.2)
57
- thor (1.0.1)
70
+ rspec-support (~> 3.10.0)
71
+ rspec-support (3.10.2)
72
+ sys-uname (1.2.2)
73
+ ffi (~> 1.1)
74
+ thor (1.1.0)
58
75
 
59
76
  PLATFORMS
60
77
  ruby
@@ -72,4 +89,4 @@ RUBY VERSION
72
89
  ruby 2.6.6p146
73
90
 
74
91
  BUNDLED WITH
75
- 2.2.14
92
+ 2.2.17
data/Gemfile.ruby300.lock CHANGED
@@ -1,71 +1,59 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (6.1.3.1)
5
- concurrent-ruby (~> 1.0, >= 1.0.2)
6
- i18n (>= 1.6, < 2)
7
- minitest (>= 5.1)
8
- tzinfo (~> 2.0)
9
- zeitwerk (~> 2.3)
10
- aruba (1.0.4)
4
+ aruba (2.0.0)
5
+ bundler (>= 1.17, < 3.0)
11
6
  childprocess (>= 2.0, < 5.0)
12
- contracts (~> 0.16.0)
13
- cucumber (>= 2.4, < 6.0)
7
+ contracts (>= 0.16.0, < 0.18.0)
8
+ cucumber (>= 4.0, < 8.0)
14
9
  rspec-expectations (~> 3.4)
15
10
  thor (~> 1.0)
16
11
  builder (3.2.4)
17
12
  childprocess (4.0.0)
18
- concurrent-ruby (1.1.8)
19
13
  contracts (0.16.0)
20
- cucumber (5.3.0)
14
+ cucumber (7.1.0)
21
15
  builder (~> 3.2, >= 3.2.4)
22
- cucumber-core (~> 8.0, >= 8.0.1)
23
- cucumber-create-meta (~> 2.0, >= 2.0.2)
24
- cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
25
- cucumber-gherkin (~> 15.0, >= 15.0.2)
26
- cucumber-html-formatter (~> 9.0, >= 9.0.0)
27
- cucumber-messages (~> 13.1, >= 13.1.0)
28
- cucumber-wire (~> 4.0, >= 4.0.1)
16
+ cucumber-core (~> 10.1, >= 10.1.0)
17
+ cucumber-create-meta (~> 6.0, >= 6.0.1)
18
+ cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
19
+ cucumber-gherkin (~> 22.0, >= 22.0.0)
20
+ cucumber-html-formatter (~> 17.0, >= 17.0.0)
21
+ cucumber-messages (~> 17.1, >= 17.1.1)
22
+ cucumber-wire (~> 6.2, >= 6.2.0)
29
23
  diff-lcs (~> 1.4, >= 1.4.4)
24
+ mime-types (~> 3.3, >= 3.3.1)
30
25
  multi_test (~> 0.1, >= 0.1.2)
31
- sys-uname (~> 1.2, >= 1.2.1)
32
- cucumber-core (8.0.1)
33
- cucumber-gherkin (~> 15.0, >= 15.0.2)
34
- cucumber-messages (~> 13.0, >= 13.0.1)
35
- cucumber-tag-expressions (~> 2.0, >= 2.0.4)
36
- cucumber-create-meta (2.0.4)
37
- cucumber-messages (~> 13.1, >= 13.1.0)
38
- sys-uname (~> 1.2, >= 1.2.1)
39
- cucumber-cucumber-expressions (10.3.0)
40
- cucumber-gherkin (15.0.2)
41
- cucumber-messages (~> 13.0, >= 13.0.1)
42
- cucumber-html-formatter (9.0.0)
43
- cucumber-messages (~> 13.0, >= 13.0.1)
44
- cucumber-messages (13.2.1)
45
- protobuf-cucumber (~> 3.10, >= 3.10.8)
46
- cucumber-tag-expressions (2.0.4)
47
- cucumber-wire (4.0.1)
48
- cucumber-core (~> 8.0, >= 8.0.1)
49
- cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
50
- cucumber-messages (~> 13.0, >= 13.0.1)
26
+ sys-uname (~> 1.2, >= 1.2.2)
27
+ cucumber-core (10.1.0)
28
+ cucumber-gherkin (~> 22.0, >= 22.0.0)
29
+ cucumber-messages (~> 17.1, >= 17.1.1)
30
+ cucumber-tag-expressions (~> 4.0, >= 4.0.2)
31
+ cucumber-create-meta (6.0.4)
32
+ cucumber-messages (~> 17.1, >= 17.1.1)
33
+ sys-uname (~> 1.2, >= 1.2.2)
34
+ cucumber-cucumber-expressions (14.0.0)
35
+ cucumber-gherkin (22.0.0)
36
+ cucumber-messages (~> 17.1, >= 17.1.1)
37
+ cucumber-html-formatter (17.0.0)
38
+ cucumber-messages (~> 17.1, >= 17.1.0)
39
+ cucumber-messages (17.1.1)
40
+ cucumber-tag-expressions (4.1.0)
41
+ cucumber-wire (6.2.0)
42
+ cucumber-core (~> 10.1, >= 10.1.0)
43
+ cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
44
+ cucumber-messages (~> 17.1, >= 17.1.1)
51
45
  diff-lcs (1.4.4)
52
- ffi (1.15.0)
53
- gemika (0.5.0)
54
- i18n (1.8.10)
55
- concurrent-ruby (~> 1.0)
46
+ ffi (1.15.4)
47
+ gemika (0.6.1)
56
48
  mail (2.7.1)
57
49
  mini_mime (>= 0.1.1)
58
- middleware (0.1.0)
50
+ mime-types (3.4.1)
51
+ mime-types-data (~> 3.2015)
52
+ mime-types-data (3.2021.1115)
59
53
  mini_mime (1.0.3)
60
- minitest (5.14.4)
61
54
  multi_test (0.1.2)
62
55
  nokogiri (1.11.2-x86_64-linux)
63
56
  racc (~> 1.4)
64
- protobuf-cucumber (3.10.8)
65
- activesupport (>= 3.2)
66
- middleware
67
- thor
68
- thread_safe
69
57
  racc (1.5.2)
70
58
  rake (13.0.3)
71
59
  rspec (3.10.0)
@@ -84,10 +72,6 @@ GEM
84
72
  sys-uname (1.2.2)
85
73
  ffi (~> 1.1)
86
74
  thor (1.1.0)
87
- thread_safe (0.3.6)
88
- tzinfo (2.0.4)
89
- concurrent-ruby (~> 1.0)
90
- zeitwerk (2.4.2)
91
75
 
92
76
  PLATFORMS
93
77
  x86_64-linux
data/README.md CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
 
22
22
  ## Supported versions
23
23
 
24
- Spreewald is currently tested against Ruby 2.4.5 with Rails 4 and Capybara 2 and Ruby 2.6.6 with Rails 6 and Capybara 3.
24
+ Spreewald is currently tested against and Ruby 2.6.6 with Rails 6 and Capybara 3.
25
25
 
26
26
  ## Usage
27
27
 
@@ -298,7 +298,7 @@ the step definitions.
298
298
  * **When I switch back to the whole page**
299
299
 
300
300
  This step can be used to switch back to the whole page if you switched
301
- to operating inside an iframe before (step `I switch to the ... iframe`)
301
+ to operating inside an iframe before (step `I switch to the ... iframe`).
302
302
 
303
303
  Please note: This step is only available for Capybara >= 3.
304
304
 
@@ -460,26 +460,20 @@ deprecation notice. Decide for yourself whether you want to use them:
460
460
  Attach a file to a file upload form field
461
461
 
462
462
 
463
- * **Then I should see "..."**
463
+ * **Then I should( not)? see "..."**
464
464
 
465
465
  Checks that some text appears on the page
466
466
 
467
467
  Note that this does not detect if the text might be hidden via CSS
468
468
 
469
469
 
470
- * **Then I should see /.../**
470
+ * **Then I should( not)? see /.../**
471
471
 
472
472
  Checks that a regexp appears on the page
473
473
 
474
474
  Note that this does not detect if the text might be hidden via CSS
475
475
 
476
476
 
477
- * **Then I should not see "..."**
478
-
479
-
480
- * **Then I should not see /.../**
481
-
482
-
483
477
  * **Then I should( not)? see a field "..."**
484
478
 
485
479
  Checks for the existance of an input field (given its id or label)
@@ -494,26 +488,23 @@ deprecation notice. Decide for yourself whether you want to use them:
494
488
  See [here](https://makandracards.com/makandra/1225-test-that-a-number-or-money-amount-is-shown-with-cucumber) for details
495
489
 
496
490
 
497
- * **Then I should see '...'**
491
+ * **Then I should( not)? see '...'**
498
492
 
499
493
  Like `Then I should see`, but with single instead of double quotes. In case
500
494
  the expected string contains quotes as well.
501
495
 
502
496
 
503
- * **Then I should see "..." in the HTML**
497
+ * **Then I should( not)? see "..." in the HTML**
504
498
 
505
499
  Check that the raw HTML contains a string
506
500
 
507
501
 
508
- * **Then I should not see "..." in the HTML**
509
-
510
-
511
502
  * **Then I should see an error**
512
503
 
513
504
  Checks that status code is 400..599
514
505
 
515
506
 
516
- * **Then I should (not )?see (an|the) element "..."**
507
+ * **Then I should( not)? see (an|the) element "..."**
517
508
 
518
509
  Check that an element with the given selector is present on the page.
519
510
 
@@ -525,7 +516,7 @@ deprecation notice. Decide for yourself whether you want to use them:
525
516
  Then I should not see the element ".sidebar"
526
517
 
527
518
 
528
- * **Then I should (not )?see (an|the) element for ...**
519
+ * **Then I should( not)? see (an|the) element for ...**
529
520
 
530
521
  Check that an element with the given [selector alias](https://github.com/makandra/spreewald/blob/master/examples/selectors.rb) is present on the page.
531
522
 
@@ -555,12 +546,12 @@ deprecation notice. Decide for yourself whether you want to use them:
555
546
  Checks that the page contains a link with a given text or title attribute.
556
547
 
557
548
 
558
- * **Then the "..." field should (not )?contain "..."**
549
+ * **Then the "..." field should( not)? contain "..."**
559
550
 
560
551
  Checks that an input field contains some value (allowing * as wildcard character)
561
552
 
562
553
 
563
- * **Then the "..." field should (not )?contain:**
554
+ * **Then the "..." field should( not)? contain:**
564
555
 
565
556
  Checks that a multiline textarea contains some value (allowing * as wildcard character)
566
557
 
data/Rakefile CHANGED
@@ -17,14 +17,16 @@ namespace :matrix do
17
17
 
18
18
  if gemfile.nil? || ruby.nil?
19
19
  warn 'Please state the Gemfile and Ruby version to be used for the Testrun!'
20
+ exit 1
20
21
  else
21
- run_tests(gemfile, ruby)
22
+ success = run_tests(gemfile, ruby)
23
+ exit success ? 0 : 1
22
24
  end
23
25
  end
24
26
 
25
27
 
26
28
  desc "Run all tests which are available for current Ruby (#{RUBY_VERSION})"
27
- task :tests, [:gemfile, :ruby] do |_t, args|
29
+ task :tests do
28
30
  Gemika::Matrix.from_ci_config.each do |row|
29
31
  run_tests(row.gemfile, row.ruby)
30
32
  end
@@ -72,15 +74,7 @@ end
72
74
 
73
75
  def cucumber_command(directory, ruby_version)
74
76
  command = "cd #{directory} && BUNDLE_GEMFILE=Gemfile bundle exec cucumber --publish-quiet"
75
- if Gem::Version.new(ruby_version) > Gem::Version.new('2.5')
76
- # Modern cucumber sees pending tests as failures.
77
- # We don't want this.
78
- command << ' --no-strict-pending'
79
- else
80
- # Ruby < 2.5 means the capybara 2 Test project.
81
- # Omit scenarios that only work with modern Capybara.
82
- command << ' --tags "not @not-capybara-2"'
83
- end
77
+ command << ' --no-strict-pending'
84
78
  command
85
79
  end
86
80
 
data/examples/paths.rb CHANGED
@@ -51,6 +51,13 @@ module NavigationHelpers
51
51
 
52
52
  private
53
53
 
54
+ def path_to_show_or_edit(action_prose, model_prose, identifier)
55
+ model = model_prose_to_class(model_prose)
56
+ route = "#{action_prose == 'form' ? 'edit_' : ''}#{model_prose_to_route_segment(model_prose)}_path"
57
+ # For find_by_anything see https://makandracards.com/makandra/6361-find-an-activerecord-by-any-column-useful-for-cucumber-steps
58
+ send(route, model.find_by_anything!(identifier))
59
+ end
60
+
54
61
  def model_prose_to_class(model_prose)
55
62
  model_prose.gsub(' ', '_').classify.constantize
56
63
  end
@@ -11,11 +11,15 @@ Feature: The `spreewald` binary
11
11
  Then the output should contain:
12
12
  """
13
13
  # All Spreewald steps containing 'should not see'
14
- Then I should not see "..."
15
- Then I should not see "..." in the HTML
16
- Then I should not see /.../
17
- """
18
- But the output should not contain "Then I should see"
14
+ Then I should( not)? see "..."
15
+ Then I should( not)? see "..." in the HTML
16
+ Then I should( not)? see "..." inside any "..."
17
+ Then I should( not)? see '...'
18
+ Then I should( not)? see (an|the) element "..."
19
+ Then I should( not)? see (an|the) element for ...
20
+ Then I should( not)? see /.../
21
+ """
22
+ But the output should not contain "Then show me the page"
19
23
  And the output should not contain "mail"
20
24
 
21
25
 
@@ -43,15 +47,15 @@ Feature: The `spreewald` binary
43
47
  """
44
48
  Then(/it strips parentheses/) do
45
49
  Then /^(?:|I )should see \/([^\/]*)\/$/ do
46
- Then(/^the "(.*?)" field should (not )?contain:$/) do
50
+ Then(/^the "(.*?)" field should( not)? contain:$/) do
47
51
  """
48
52
 
49
53
  When I run `spreewald`
50
54
  Then the output should contain "Then it strips parentheses"
51
- And the output should contain "Then I should see /.../"
55
+ And the output should contain "Then I should( not)? see /.../"
52
56
  And the output should contain:
53
57
  """
54
- Then the "..." field should (not )?contain:
58
+ Then the "..." field should( not)? contain:
55
59
  """
56
60
 
57
61
 
@@ -11,11 +11,6 @@ Then 'console' do
11
11
  require 'irb'
12
12
  ARGV.clear # IRB takes ARGV as its own arguments
13
13
 
14
- # `source` is defined by Capybara as a shortcut to `page.source`. IRB tries to
15
- # create an alias with the same name and fails with a warning. To avoid this,
16
- # we remove the alias here.
17
- undef :source
18
-
19
14
  # We adapted the steps of IRB.run
20
15
  # https://github.com/ruby/ruby/blob/c08f7b80889b531865e74bc5f573df8fa27f2088/lib/irb.rb#L418
21
16
  # with injected workspace. See https://github.com/makandra/spreewald/issues/77 for reasons.
@@ -24,6 +19,11 @@ Then 'console' do
24
19
  # "already initialized constant" warnings
25
20
  unless IRB.conf[:LOAD_MODULES]
26
21
  IRB.setup(nil)
22
+
23
+ # `source` is defined by Capybara as a shortcut to `page.source`. IRB tries to
24
+ # create an alias with the same name and fails with a warning. To avoid this,
25
+ # we remove the alias here.
26
+ undef :source
27
27
  end
28
28
 
29
29
  workspace = IRB::WorkSpace.new(binding)
@@ -1,6 +1,8 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  require 'spreewald_support/mail_finder'
4
+ require 'steps/show_me_the_mails'
5
+ require 'steps/follow_the_link'
4
6
 
5
7
  Before do
6
8
  ActionMailer::Base.deliveries.clear
@@ -73,18 +75,7 @@ end.overridable
73
75
  # Other links (such as mailto: or ftp:// links) are ignored.
74
76
  When /^I follow the (first|second|third)? ?link in the e?mail$/ do |index_in_words|
75
77
  mail = @mail || ActionMailer::Base.deliveries.last
76
- index = { nil => 0, 'first' => 0, 'second' => 1, 'third' => 2 }[index_in_words]
77
- url_pattern = %r((?:https?://[^/]+)([^"'\s]+))
78
-
79
- paths = if mail.html_part
80
- dom = Nokogiri::HTML(mail.html_part.body.to_s)
81
- (dom / 'a[href]').map { |a| a['href'].match(url_pattern) }.compact.map { |match| match[1] }
82
- else
83
- mail_body = MailFinder.email_text_body(mail).to_s
84
- mail_body.scan(url_pattern).flatten(1)
85
- end
86
-
87
- visit paths[index]
78
+ Spreewald::Steps::FollowTheLink.new(mail, index_in_words).run
88
79
  end.overridable
89
80
 
90
81
  Then /^no e?mail should have been sent$/ do
@@ -98,12 +89,7 @@ end.overridable
98
89
 
99
90
  # Print all sent emails to STDOUT (optionally only the headers).
100
91
  Then /^show me the e?mail( header)?s$/ do |only_header|
101
- if ActionMailer::Base.deliveries.empty?
102
- puts MailFinder.show_mails(ActionMailer::Base.deliveries, only_header)
103
- else
104
- puts "No emails found" if ActionMailer::Base.deliveries.empty?
105
- end
106
-
92
+ Spreewald::Steps::ShowMeTheMails.new(ActionMailer::Base.deliveries, only_header).run
107
93
  end.overridable
108
94
 
109
95
  # Print a subset of all sent emails to STDOUT