spreewald 2.99.3 → 4.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 (146) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +40 -0
  3. data/CHANGELOG.md +45 -4
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +2 -2
  6. data/Gemfile.ruby245 +3 -0
  7. data/Gemfile.ruby245.lock +10 -1
  8. data/Gemfile.ruby266 +3 -0
  9. data/Gemfile.ruby266.lock +12 -2
  10. data/README.md +40 -32
  11. data/Rakefile +34 -19
  12. data/features/binary.feature +2 -2
  13. data/features/support/step_definitions/custom_steps.rb +10 -0
  14. data/lib/spreewald.rb +1 -0
  15. data/lib/spreewald/development_steps.rb +1 -8
  16. data/lib/spreewald/email_steps.rb +3 -43
  17. data/lib/spreewald/frame_steps.rb +77 -0
  18. data/lib/spreewald/web_steps.rb +17 -61
  19. data/lib/spreewald_support/mail_finder.rb +12 -13
  20. data/lib/spreewald_support/mail_to_plaintext_converter.rb +42 -0
  21. data/lib/spreewald_support/unsupported_email_header.rb +22 -0
  22. data/lib/spreewald_support/version.rb +1 -1
  23. data/spec/spreewald_support/mail_to_plaintext_converter_spec.rb +60 -0
  24. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Gemfile +1 -1
  25. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Gemfile.lock +14 -16
  26. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/README.rdoc +0 -0
  27. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Rakefile +0 -0
  28. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/app +0 -0
  29. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/bundle +0 -0
  30. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/rails +0 -0
  31. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/rake +0 -0
  32. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/setup +0 -0
  33. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config.ru +0 -0
  34. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/application.rb +0 -0
  35. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/boot.rb +0 -0
  36. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/cucumber.yml +0 -0
  37. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/database.yml +0 -0
  38. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environment.rb +0 -0
  39. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environments/development.rb +0 -0
  40. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environments/test.rb +0 -0
  41. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/backtrace_silencers.rb +0 -0
  42. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/cookies_serializer.rb +0 -0
  43. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/filter_parameter_logging.rb +0 -0
  44. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/inflections.rb +0 -0
  45. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/mime_types.rb +0 -0
  46. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/session_store.rb +0 -0
  47. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/silence_deprecation_warnings.rb +0 -0
  48. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/to_time_preserves_timezone.rb +0 -0
  49. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/wrap_parameters.rb +0 -0
  50. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/locales/en.yml +0 -0
  51. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/config/routes.rb +0 -0
  52. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/secrets.yml +0 -0
  53. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/db +0 -0
  54. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/browser_tab_steps.feature +0 -0
  55. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/development_steps.feature +0 -0
  56. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/email_steps.feature +0 -0
  57. data/tests/rails-4_capybara-2/features/iframe_steps.feature +1 -0
  58. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/overriding.feature +0 -0
  59. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/session_steps.feature +0 -0
  60. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/step_definitions/overriding_steps.rb +0 -0
  61. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/step_definitions/test_steps.rb +0 -0
  62. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/support/env.rb +0 -0
  63. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/features/support/paths.rb +0 -0
  64. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/features/support/selectors.rb +0 -0
  65. data/tests/rails-4_capybara-2/features/support/selenium.rb +1 -0
  66. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/table_steps.feature +0 -0
  67. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/time_steps.feature +0 -0
  68. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/web_steps.feature +0 -0
  69. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/lib/tasks/cucumber.rake +0 -0
  70. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/log/.keep +0 -0
  71. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/404.html +0 -0
  72. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/422.html +0 -0
  73. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/500.html +0 -0
  74. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/favicon.ico +0 -0
  75. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/fixture_files +0 -0
  76. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/script/cucumber +0 -0
  77. data/tests/rails-6_capybara-3/Gemfile.lock +2 -2
  78. data/tests/rails-6_capybara-3/app/mailers/spreewald_mailer.rb +16 -0
  79. data/tests/rails-6_capybara-3/features/iframe_steps.feature +1 -0
  80. data/tests/rails-6_capybara-3/features/support/selenium.rb +1 -0
  81. data/tests/shared/app/controllers/emails_controller.rb +20 -0
  82. data/tests/shared/app/controllers/iframes_controller.rb +11 -0
  83. data/tests/shared/app/controllers/static_pages_controller.rb +12 -8
  84. data/tests/shared/app/models/mailer.rb +32 -0
  85. data/tests/shared/app/views/forms/checkbox_form.html.haml +3 -0
  86. data/tests/shared/app/views/forms/disabled_elements.html.haml +1 -0
  87. data/tests/shared/app/views/forms/form1.html.haml +4 -1
  88. data/tests/shared/app/views/forms/invalid_form.html.haml +3 -0
  89. data/tests/shared/app/views/iframes/iframe_1_content.haml +12 -0
  90. data/tests/shared/app/views/iframes/iframe_2_content.haml +12 -0
  91. data/tests/shared/app/views/mailer/html_email_for_failed_test_without_header.haml +5 -0
  92. data/tests/shared/app/views/mailer/html_email_for_successful_test_without_header.haml +7 -0
  93. data/tests/shared/app/views/mailer/text_email_for_failed_test_without_header.text.erb +1 -0
  94. data/tests/shared/app/views/mailer/text_email_for_successful_test_without_header.text.erb +3 -0
  95. data/tests/shared/app/views/static_pages/iframe.haml +3 -0
  96. data/tests/shared/config/routes.rb +8 -0
  97. data/tests/shared/features/shared/email_steps.feature +172 -35
  98. data/tests/shared/features/shared/iframe_steps.feature +38 -0
  99. data/tests/shared/features/shared/step_definitions/test_steps.rb +5 -6
  100. data/tests/shared/features/shared/web_steps.feature +15 -10
  101. data/tests/shared/features/support/selenium.rb +10 -0
  102. metadata +137 -186
  103. data/.travis.yml +0 -29
  104. data/Gemfile.ruby218 +0 -7
  105. data/Gemfile.ruby218.lock +0 -58
  106. data/lib/spreewald/file_attachment_steps.rb +0 -22
  107. data/lib/spreewald/timecop_steps.rb +0 -9
  108. data/tests/rails-3_capybara-1/.ruby-version +0 -1
  109. data/tests/rails-3_capybara-1/Gemfile +0 -20
  110. data/tests/rails-3_capybara-1/Gemfile.lock +0 -182
  111. data/tests/rails-3_capybara-1/Rakefile +0 -18
  112. data/tests/rails-3_capybara-1/app +0 -1
  113. data/tests/rails-3_capybara-1/config.ru +0 -4
  114. data/tests/rails-3_capybara-1/config/application.rb +0 -29
  115. data/tests/rails-3_capybara-1/config/boot.rb +0 -15
  116. data/tests/rails-3_capybara-1/config/cucumber.yml +0 -1
  117. data/tests/rails-3_capybara-1/config/database.yml +0 -1
  118. data/tests/rails-3_capybara-1/config/environment.rb +0 -7
  119. data/tests/rails-3_capybara-1/config/initializers/backtrace_silencers.rb +0 -9
  120. data/tests/rails-3_capybara-1/config/initializers/inflections.rb +0 -12
  121. data/tests/rails-3_capybara-1/config/initializers/mime_types.rb +0 -7
  122. data/tests/rails-3_capybara-1/config/initializers/secret_token.rb +0 -9
  123. data/tests/rails-3_capybara-1/config/initializers/session_store.rb +0 -5
  124. data/tests/rails-3_capybara-1/db +0 -1
  125. data/tests/rails-3_capybara-1/features/shared +0 -1
  126. data/tests/rails-3_capybara-1/features/support/env.rb +0 -65
  127. data/tests/rails-3_capybara-1/features/support/selenium.rb +0 -3
  128. data/tests/rails-3_capybara-1/public +0 -1
  129. data/tests/rails-3_capybara-1/script/rails +0 -6
  130. data/tests/rails-3_capybara-2/.ruby-version +0 -1
  131. data/tests/rails-3_capybara-2/Gemfile +0 -21
  132. data/tests/rails-3_capybara-2/Gemfile.lock +0 -191
  133. data/tests/rails-3_capybara-2/Rakefile +0 -1
  134. data/tests/rails-3_capybara-2/app +0 -1
  135. data/tests/rails-3_capybara-2/config +0 -1
  136. data/tests/rails-3_capybara-2/config.ru +0 -1
  137. data/tests/rails-3_capybara-2/db +0 -1
  138. data/tests/rails-3_capybara-2/features +0 -1
  139. data/tests/rails-3_capybara-2/public +0 -1
  140. data/tests/rails-3_capybara-2/script +0 -1
  141. data/tests/rails-4_capybara-3/config/routes.rb +0 -1
  142. data/tests/rails-4_capybara-3/features/support/paths.rb +0 -1
  143. data/tests/rails-4_capybara-3/features/support/selectors.rb +0 -1
  144. data/tests/rails-4_capybara-3/features/support/selenium.rb +0 -3
  145. data/tests/rails-4_capybara-3/script/cucumber +0 -10
  146. data/tests/rails-6_capybara-3/features/support/selenium.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71f40dbc5a327e21940b95c4a4a9b1946e0c30b2090e3f46e927b81f3f44a18b
4
- data.tar.gz: c464bee9033caa6ae2b32984058aa0e37128483a2aa299780e60297b5c81b7d4
3
+ metadata.gz: 6b97388391eda8359eab973a0a92896ee7d10e7fc4db749b7f22fb326eddf268
4
+ data.tar.gz: 77aea5e617594133107957b887d5f4848a91532fc46b835b1b5af07164f652e2
5
5
  SHA512:
6
- metadata.gz: a927120e6558399206bbd0c97e08c7410f7af5e700b1756daa091e961f9407c237509496791d4dc8f58a7c3e74ab3b78a6b97bca2b1bffa1dc1824ebf999a040
7
- data.tar.gz: 12964e9c67396df967c29d1fa3925b6e01f0d0ba747ed016d15fa1cbee2c02e8b71173f6cf57e953cec9ad0d3df7dba6caf71d253e54739e3444c1b22687c2ef
6
+ metadata.gz: 43272a84d5e31da1f22426ef84908591696765e4ca394a7ac85ad1d87ffa194aefb7169a104743c162f79b4ab4e9048966c760a51741be2e78d29d3263a3760a
7
+ data.tar.gz: 4bb7a38423937d4b5675dfdff73c3309632d7400152389b9e0617f178be076cd156234e7519faa71f97df7bc90a386c5cd87858cb9a96e6ea1c1f163c468dd30
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: Tests
3
+ 'on':
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-20.04
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ include:
17
+ # Test projects
18
+ - ruby: 2.4.5
19
+ gemfile: tests/rails-4_capybara-2/Gemfile
20
+ - ruby: 2.6.6
21
+ gemfile: tests/rails-6_capybara-3/Gemfile
22
+ # Used to run rspec and integration tests for spreewald binary:
23
+ - ruby: 2.4.5
24
+ gemfile: Gemfile.ruby245
25
+ - ruby: 2.6.6
26
+ gemfile: Gemfile.ruby266
27
+ env:
28
+ BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
29
+ steps:
30
+ - uses: actions/checkout@v2
31
+ - name: Install ruby
32
+ uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: "${{ matrix.ruby }}"
35
+ - name: Bundle
36
+ run: |
37
+ gem install bundler:1.17.3
38
+ bundle install --no-deployment
39
+ - name: Run tests
40
+ run: bundle exec rake matrix:single_test[${{ matrix.gemfile }},${{ matrix.ruby }}]
data/CHANGELOG.md CHANGED
@@ -3,16 +3,57 @@ 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
- ## 2.99.3
7
- - Introduce wildcard for the beginning of a line. (see issue #155)
6
+ ## 4.0.0
7
+
8
+ - Dropped support for capybara 1, Ruby 2.1 and Rails 3.2.
9
+
10
+ ## 3.0.3
11
+
12
+ - The `an email should have been sent with` step now interprets all lines as body when not specifying headers (see issue [#157](https://github.com/makandra/spreewald/issues/157))
13
+
14
+ ## 3.0.2
15
+
16
+ - Introduce wildcard for the beginning of a line. (see issue [#155](https://github.com/makandra/spreewald/issues/155))
8
17
  - This will allow you to check for a specific sentence inside the body
9
18
 
10
- ## 2.99.2
19
+ ## 3.0.1
11
20
 
12
21
  - Fix deduplication of linebreaks for html mails in mail finder. (see issue [#153](https://github.com/makandra/spreewald/issues/153))
13
22
 
14
- ## 2.99.1
23
+ ## 3.0.0
15
24
 
25
+ ### Breaking changes
26
+
27
+ - The following steps have been removed:
28
+ - `/^the file "([^"]*)" was attached(?: as (?:([^"]*)\/)?([^"]*))? to the ([^"]*) above(?: at "([^"]*)")?$/` (see [#106](https://github.com/makandra/spreewald/issues/106), this functionality was moved to [CucumberFactory](https://github.com/makandra/cucumber_factory))
29
+ - `/^the "([^"]*)" field should have no error$/` (see [#134](https://github.com/makandra/spreewald/issues/134))
30
+ - `/^I should get a text response$/` (see [#135](https://github.com/makandra/spreewald/issues/135))
31
+ - `/^I wait for the page to load$/` (see [#136](https://github.com/makandra/spreewald/issues/136))
32
+ - `debugger` (was an alias for `console`)
33
+ - These email steps have been removed in favor of `(an?|no)( HTML| plain-text|) e?mail should have been sent with:` (see [#132](https://github.com/makandra/spreewald/issues/132#issuecomment-631457290)):
34
+ - `/^(an|no) e?mail should have been sent((?: |and|with|from "[^"]+"|bcc "[^"]+"|cc "[^"]+"|to "[^"]+"|the subject "[^"]+"|the body "[^"]+"|the attachments "[^"]+")+)$/`
35
+ - `/^that e?mail should( not)? have the following lines in the body$/`
36
+ - `/^that e?mail should have the following (?:|content in the )body:$/`
37
+ - The `and disabled` modifier of the step `the "..." checkbox should( not)? be checked` has been removed. Use the step without the modifier together with the step `the "..." checkbox should be disabled` to achieve the old behavior.
38
+ - The step `/^(the tag )?"([^\"]+)" should( not)? be visible$/` lost its `not` modifier (Use `Then (the tag )?"..." should be hidden` or `Then I should not see "..."`)
39
+ - The file `lib/spreewald/timecop_steps.rb` was removed (was an alias for `lib/spreewald/time_steps.rb`).
40
+ - The step `(an?|no)( HTML| plain-text|) e?mail should have been sent with:` does now require that the whole body is matched.
41
+ - All web steps interacting with forms will now find both enabled and disabled fields. We encourage you to assert the "disabled" state in a separate step when needed, Spreewald offers these steps as well.
42
+
43
+ The following steps have been adjusted:
44
+ - `I should( not)? see a field "..."`
45
+ - `the "..." field should( not)? contain "..."`
46
+ - `I should see a form with the following values:`
47
+ - `the "..." field should have the error "..."`
48
+ - `the "..." field should( not)? have an error`
49
+ - `the "..." checkbox should( not)? be checked`
50
+ - `"..." should be selected for "..."`
51
+ - `nothing should be selected for "..."`
52
+ - `"..." should( not)? be an option for "..."`
53
+ - `the "..." field should( not)? be visible`
54
+ - `the "..." select should( not)? be sorted`
55
+
56
+ ### Compatible changes
16
57
  - Reintroduced support for emails with CRLF line ending
17
58
 
18
59
  ## 2.99.0
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'rake'
4
- gem 'gemika'
4
+ gem 'gemika'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- gemika (0.4.0)
4
+ gemika (0.5.0)
5
5
  rake (12.3.2)
6
6
 
7
7
  PLATFORMS
@@ -12,4 +12,4 @@ DEPENDENCIES
12
12
  rake
13
13
 
14
14
  BUNDLED WITH
15
- 1.17.3
15
+ 2.2.14
data/Gemfile.ruby245 CHANGED
@@ -1,7 +1,10 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'rake'
3
4
  gem 'rspec'
4
5
  gem 'cucumber'
5
6
  gem 'aruba'
6
7
 
7
8
  gem 'gemika'
9
+ gem 'mail'
10
+ gem 'nokogiri'
data/Gemfile.ruby245.lock CHANGED
@@ -31,10 +31,16 @@ GEM
31
31
  cucumber-wire (0.0.1)
32
32
  diff-lcs (1.3)
33
33
  ffi (1.10.0)
34
- gemika (0.3.4)
34
+ gemika (0.5.0)
35
35
  gherkin (5.1.0)
36
+ mail (2.7.1)
37
+ mini_mime (>= 0.1.1)
38
+ mini_mime (1.0.1)
39
+ mini_portile2 (2.4.0)
36
40
  multi_json (1.13.1)
37
41
  multi_test (0.1.2)
42
+ nokogiri (1.10.10)
43
+ mini_portile2 (~> 2.4.0)
38
44
  rake (12.3.2)
39
45
  rspec (3.8.0)
40
46
  rspec-core (~> 3.8.0)
@@ -58,6 +64,9 @@ DEPENDENCIES
58
64
  aruba
59
65
  cucumber
60
66
  gemika
67
+ mail
68
+ nokogiri
69
+ rake
61
70
  rspec
62
71
 
63
72
  BUNDLED WITH
data/Gemfile.ruby266 CHANGED
@@ -2,8 +2,11 @@ source 'https://rubygems.org'
2
2
 
3
3
  ruby '2.6.6'
4
4
 
5
+ gem 'rake'
5
6
  gem 'rspec'
6
7
  gem 'cucumber'
7
8
  gem 'aruba'
8
9
 
9
10
  gem 'gemika'
11
+ gem 'mail'
12
+ gem 'nokogiri'
data/Gemfile.ruby266.lock CHANGED
@@ -30,10 +30,17 @@ GEM
30
30
  cucumber-wire (0.0.1)
31
31
  diff-lcs (1.3)
32
32
  ffi (1.12.2)
33
- gemika (0.4.0)
33
+ gemika (0.5.0)
34
34
  gherkin (5.1.0)
35
+ mail (2.7.1)
36
+ mini_mime (>= 0.1.1)
37
+ mini_mime (1.0.2)
35
38
  multi_json (1.14.1)
36
39
  multi_test (0.1.2)
40
+ nokogiri (1.11.1-x86_64-linux)
41
+ racc (~> 1.4)
42
+ racc (1.5.2)
43
+ rake (13.0.3)
37
44
  rspec (3.9.0)
38
45
  rspec-core (~> 3.9.0)
39
46
  rspec-expectations (~> 3.9.0)
@@ -56,10 +63,13 @@ DEPENDENCIES
56
63
  aruba
57
64
  cucumber
58
65
  gemika
66
+ mail
67
+ nokogiri
68
+ rake
59
69
  rspec
60
70
 
61
71
  RUBY VERSION
62
72
  ruby 2.6.6p146
63
73
 
64
74
  BUNDLED WITH
65
- 2.1.4
75
+ 2.2.14
data/README.md CHANGED
@@ -19,9 +19,9 @@ Or install it yourself as:
19
19
  $ gem install spreewald
20
20
 
21
21
 
22
- ## Supported RSpec versions
22
+ ## Supported versions
23
23
 
24
- Spreewald supports RSpec >= 2.13.0
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.
25
25
 
26
26
  ## Usage
27
27
 
@@ -197,8 +197,7 @@ the step definitions.
197
197
  * **Then console**
198
198
 
199
199
  Pauses test execution and opens an IRB shell with current context. Does not halt the application-
200
- under-test. (Replaces the "Then debugger" step that has never been adequate
201
- for its job)
200
+ under-test.
202
201
 
203
202
 
204
203
  * **AfterStep @slow-motion**
@@ -238,10 +237,9 @@ the step definitions.
238
237
 
239
238
  """
240
239
 
241
- Because of backwards-compatibility, the body currently only has to be a prefix
242
- of the real body. However, this is deprecated and will be removed in a future
243
- version. Use wildcards instead.
244
- You may skip lines in the header, of course.
240
+ You may skip lines in the header.
241
+ Please note: In older versions of Spreewald, unmentioned body lines were skipped.
242
+ Now you have to use the asterisk explicitly to omit lines in the body.
245
243
 
246
244
 
247
245
  * **When I follow the (first|second|third)? link in the e?mail**
@@ -269,11 +267,40 @@ the step definitions.
269
267
  This uses the same syntax as `Then an email should have been sent with:`
270
268
 
271
269
 
272
- ### file_attachment_steps.rb
270
+ ### frame_steps.rb
273
271
 
274
- * **Given the file "..." was attached( as (.../)?...)? to the ... above( at "...")?**
272
+ * **When ... inside the ... iframe**
275
273
 
276
- This step is deprecated and will be removed from spreewald. If you still want to use it, copy the code to your project's own steps.
274
+ You can append `inside the [name or number] iframe` to any other step.
275
+ Then the step will operate inside the given iframe.
276
+ Examples:
277
+
278
+ Then I should see "Kiwi" inside the 1st iframe
279
+ Then I should see "Cherry" inside the fruits iframe
280
+ When I press "Save" inside the 2nd iframe
281
+
282
+
283
+
284
+ * **When I switch to the ... iframe**
285
+
286
+ This step will switch to the iframe identified by its name or number.
287
+ All further steps will operate inside the iframe.
288
+ To switch to operating on the main page again, use the step
289
+ "I switch back to the whole page".
290
+ Examples:
291
+
292
+ When I switch to the 1st iframe
293
+ When I switch to the fruits iframe
294
+
295
+ Please note: This step is only available for Capybara >= 3.
296
+
297
+
298
+ * **When I switch back to the whole page**
299
+
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`)
302
+
303
+ Please note: This step is only available for Capybara >= 3.
277
304
 
278
305
 
279
306
  ### session_steps.rb
@@ -330,8 +357,6 @@ Please note that the two approaches branch. While ActiveSupport will freeze the
330
357
  When it is a few hours earlier
331
358
 
332
359
 
333
-
334
-
335
360
  ### web_steps.rb
336
361
 
337
362
  Most of cucumber-rails' original web steps plus a few of our own.
@@ -559,10 +584,7 @@ deprecation notice. Decide for yourself whether you want to use them:
559
584
  * **Then the "..." field should( not)? have an error**
560
585
 
561
586
 
562
- * **Then the "..." field should have no error**
563
-
564
-
565
- * **Then the "..." checkbox should( not)? be checked( and disabled)?**
587
+ * **Then the "..." checkbox should( not)? be checked?**
566
588
 
567
589
 
568
590
  * **Then the radio button "..." should( not)? be (checked|selected)**
@@ -615,14 +637,12 @@ deprecation notice. Decide for yourself whether you want to use them:
615
637
  * **When I reload the page**
616
638
 
617
639
 
618
- * **Then (the tag )?"..." should( not)? be visible**
640
+ * **Then (the tag )?"..." should be visible**
619
641
 
620
642
  Checks that an element is actually present and visible, also considering styles.
621
643
  Within a selenium test, the browser is asked whether the element is really visible
622
644
  In a non-selenium test, we only check for `.hidden`, `.invisible` or `style: display:none`
623
645
 
624
- The step 'Then (the tag )?"..." should **not** be visible' is ambiguous. Please use 'Then (the tag )?"..." should be hidden' or 'Then I should not see "..."' instead. Note that the **not** option will be removed in future versions of Spreewald.
625
-
626
646
  More details [here](https://makandracards.com/makandra/1049-capybara-check-that-a-page-element-is-hidden-via-css)
627
647
 
628
648
 
@@ -675,11 +695,6 @@ deprecation notice. Decide for yourself whether you want to use them:
675
695
  got: "http://makandra.com/" (using =~)
676
696
 
677
697
 
678
- * **Then I should get a text response**
679
-
680
- Checks that the result has content type `text/plain`
681
-
682
-
683
698
  * **When I follow "..." inside any "..."**
684
699
 
685
700
  Click a link within an element matching the given selector. Will try to be clever
@@ -715,13 +730,6 @@ deprecation notice. Decide for yourself whether you want to use them:
715
730
  Tests that a field with the given label is visible.
716
731
 
717
732
 
718
- * **When I wait for the page to load**
719
-
720
- Waits for the page to finish loading and AJAX requests to finish.
721
-
722
- More details [here](https://makandracards.com/makandra/12139-waiting-for-page-loads-and-ajax-requests-to-finish-with-capybara).
723
-
724
-
725
733
  * **When I perform basic authentication as ".../..." and go to ...**
726
734
 
727
735
  Performs HTTP basic authentication with the given credentials and visits the given path.
data/Rakefile CHANGED
@@ -10,28 +10,25 @@ end
10
10
  task :default => 'matrix:tests'
11
11
 
12
12
  namespace :matrix do
13
+ desc 'Run tests for a single row of the matrix'
14
+ task :single_test, [:gemfile, :ruby] do |_t, args|
15
+ gemfile = args[:gemfile]
16
+ ruby = args[:ruby]
13
17
 
14
- desc "Run all tests which are available for current Ruby (#{RUBY_VERSION})"
15
- task :tests do
16
- Gemika::Matrix.from_travis_yml.each do |row|
17
- directory = File.dirname(row.gemfile)
18
- if directory.start_with?('tests')
19
- # Run integration tests (uses embedded projects)
20
- system(cucumber_command(directory, row.ruby))
21
- else
22
- # Run specs and tests for spreewald binary
23
- [
24
- system("BUNDLE_GEMFILE=#{row.gemfile} bundle exec rspec"),
25
- system("BUNDLE_GEMFILE=#{row.gemfile} bundle exec cucumber"),
26
- ].all?
27
- end
18
+ if gemfile.nil? || ruby.nil?
19
+ warn 'Please state the Gemfile and Ruby version to be used for the Testrun!'
20
+ else
21
+ run_tests(gemfile, ruby)
28
22
  end
29
-
30
- travis_yml = YAML.load_file('.travis.yml')
31
- rubies = travis_yml.fetch('rvm') - [RUBY_VERSION]
32
- puts "Please remember to run tests for the other ruby versions as well: #{rubies.join(", ")}"
33
23
  end
34
24
 
25
+
26
+ desc "Run all tests which are available for current Ruby (#{RUBY_VERSION})"
27
+ task :tests, [:gemfile, :ruby] do |_t, args|
28
+ Gemika::Matrix.from_ci_config.each do |row|
29
+ run_tests(row.gemfile, row.ruby)
30
+ end
31
+ end
35
32
  end
36
33
 
37
34
 
@@ -59,12 +56,30 @@ task :update_readme do
59
56
  puts '', '> Done (diff applied).'
60
57
  end
61
58
 
59
+ def run_tests(gemfile, ruby)
60
+ directory = File.dirname(gemfile)
61
+ if directory.start_with?('tests')
62
+ # Run integration tests (uses embedded projects)
63
+ system(cucumber_command(directory, ruby))
64
+ else
65
+ # Run specs and integration tests for Spreewald binary
66
+ [
67
+ system("BUNDLE_GEMFILE=#{gemfile} bundle exec rspec"),
68
+ system("BUNDLE_GEMFILE=#{gemfile} bundle exec cucumber"),
69
+ ].all?
70
+ end
71
+ end
72
+
62
73
  def cucumber_command(directory, ruby_version)
63
- command = "cd #{directory} && BUNDLE_GEMFILE=Gemfile geordi cucumber"
74
+ command = "cd #{directory} && BUNDLE_GEMFILE=Gemfile bundle exec cucumber"
64
75
  if Gem::Version.new(ruby_version) > Gem::Version.new('2.5')
65
76
  # Modern cucumber sees pending tests as failures.
66
77
  # We don't want this.
67
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"'
68
83
  end
69
84
  command
70
85
  end
@@ -240,7 +240,7 @@ Feature: The `spreewald` binary
240
240
 
241
241
  Scenario: Print version
242
242
  When I run `spreewald --version`
243
- Then the output should contain "Spreewald 2."
243
+ Then the output should contain /Spreewald \d./
244
244
 
245
245
  When I run `spreewald -v`
246
- Then the output should contain "Spreewald 2."
246
+ Then the output should contain /Spreewald \d./