spreewald 3.0.0 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +42 -0
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +35 -0
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +2 -2
  7. data/Gemfile.ruby245 +3 -0
  8. data/Gemfile.ruby245.lock +11 -2
  9. data/Gemfile.ruby266 +3 -0
  10. data/Gemfile.ruby266.lock +12 -2
  11. data/{Gemfile.ruby218 → Gemfile.ruby300} +6 -1
  12. data/Gemfile.ruby300.lock +108 -0
  13. data/README.md +41 -3
  14. data/Rakefile +34 -19
  15. data/features/binary.feature +2 -2
  16. data/features/support/step_definitions/custom_steps.rb +10 -0
  17. data/lib/spreewald.rb +1 -0
  18. data/lib/spreewald/browser_tab_steps.rb +1 -1
  19. data/lib/spreewald/email_steps.rb +3 -1
  20. data/lib/spreewald/frame_steps.rb +77 -0
  21. data/lib/spreewald_support/mail_finder.rb +12 -10
  22. data/lib/spreewald_support/mail_to_plaintext_converter.rb +42 -0
  23. data/lib/spreewald_support/unsupported_email_header.rb +22 -0
  24. data/lib/spreewald_support/version.rb +1 -1
  25. data/spec/spreewald_support/mail_to_plaintext_converter_spec.rb +60 -0
  26. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Gemfile +1 -1
  27. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Gemfile.lock +15 -17
  28. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/README.rdoc +0 -0
  29. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Rakefile +0 -0
  30. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/app +0 -0
  31. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/bundle +0 -0
  32. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/rails +0 -0
  33. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/rake +0 -0
  34. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/setup +0 -0
  35. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config.ru +0 -0
  36. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/application.rb +0 -0
  37. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/boot.rb +0 -0
  38. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/cucumber.yml +0 -0
  39. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/database.yml +0 -0
  40. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environment.rb +0 -0
  41. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environments/development.rb +0 -0
  42. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environments/test.rb +0 -0
  43. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/backtrace_silencers.rb +0 -0
  44. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/cookies_serializer.rb +0 -0
  45. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/filter_parameter_logging.rb +0 -0
  46. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/inflections.rb +0 -0
  47. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/mime_types.rb +0 -0
  48. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/session_store.rb +0 -0
  49. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/silence_deprecation_warnings.rb +0 -0
  50. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/to_time_preserves_timezone.rb +0 -0
  51. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/wrap_parameters.rb +0 -0
  52. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/locales/en.yml +0 -0
  53. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/config/routes.rb +0 -0
  54. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/secrets.yml +0 -0
  55. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/db +0 -0
  56. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/browser_tab_steps.feature +0 -0
  57. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/development_steps.feature +0 -0
  58. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/email_steps.feature +0 -0
  59. data/tests/rails-4_capybara-2/features/iframe_steps.feature +1 -0
  60. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/overriding.feature +0 -0
  61. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/session_steps.feature +0 -0
  62. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/step_definitions/overriding_steps.rb +0 -0
  63. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/step_definitions/test_steps.rb +0 -0
  64. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/support/env.rb +0 -0
  65. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/features/support/paths.rb +0 -0
  66. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/features/support/selectors.rb +0 -0
  67. data/tests/rails-4_capybara-2/features/support/selenium.rb +1 -0
  68. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/table_steps.feature +0 -0
  69. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/time_steps.feature +0 -0
  70. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/web_steps.feature +0 -0
  71. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/lib/tasks/cucumber.rake +0 -0
  72. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/log/.keep +0 -0
  73. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/404.html +0 -0
  74. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/422.html +0 -0
  75. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/500.html +0 -0
  76. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/favicon.ico +0 -0
  77. data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/fixture_files +0 -0
  78. data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/script/cucumber +0 -0
  79. data/tests/rails-6_capybara-3/.ruby-version +1 -1
  80. data/tests/rails-6_capybara-3/Gemfile +4 -2
  81. data/tests/rails-6_capybara-3/Gemfile.lock +177 -143
  82. data/tests/rails-6_capybara-3/app/mailers/spreewald_mailer.rb +28 -0
  83. data/tests/rails-6_capybara-3/config.ru +1 -0
  84. data/tests/rails-6_capybara-3/config/cucumber.yml +1 -1
  85. data/tests/rails-6_capybara-3/config/environments/development.rb +21 -3
  86. data/tests/rails-6_capybara-3/config/environments/test.rb +12 -1
  87. data/tests/rails-6_capybara-3/config/initializers/backtrace_silencers.rb +4 -3
  88. data/tests/rails-6_capybara-3/config/initializers/filter_parameter_logging.rb +3 -1
  89. data/tests/rails-6_capybara-3/config/initializers/new_framework_defaults_6_1.rb +67 -0
  90. data/tests/rails-6_capybara-3/config/initializers/permissions_policy.rb +11 -0
  91. data/tests/rails-6_capybara-3/features/iframe_steps.feature +1 -0
  92. data/tests/rails-6_capybara-3/features/support/selenium.rb +1 -0
  93. data/tests/shared/app/controllers/emails_controller.rb +35 -0
  94. data/tests/shared/app/controllers/iframes_controller.rb +11 -0
  95. data/tests/shared/app/controllers/static_pages_controller.rb +12 -8
  96. data/tests/shared/app/models/mailer.rb +52 -0
  97. data/tests/shared/app/views/iframes/iframe_1_content.haml +12 -0
  98. data/tests/shared/app/views/iframes/iframe_2_content.haml +12 -0
  99. data/tests/shared/app/views/mailer/html_email_for_failed_test_without_header.haml +5 -0
  100. data/tests/shared/app/views/mailer/html_email_for_successful_test_without_header.haml +7 -0
  101. data/tests/shared/app/views/mailer/html_email_with_linebreaks.html +6 -0
  102. data/tests/shared/app/views/mailer/html_email_with_specific_line.haml +11 -0
  103. data/tests/shared/app/views/mailer/text_email_for_failed_test_without_header.text.erb +1 -0
  104. data/tests/shared/app/views/mailer/text_email_for_successful_test_without_header.text.erb +3 -0
  105. data/tests/shared/app/views/mailer/text_email_with_specific_line.text.erb +5 -0
  106. data/tests/shared/app/views/static_pages/iframe.haml +3 -0
  107. data/tests/shared/config/routes.rb +11 -0
  108. data/tests/shared/features/shared/email_steps.feature +240 -0
  109. data/tests/shared/features/shared/iframe_steps.feature +38 -0
  110. data/tests/shared/features/shared/step_definitions/test_steps.rb +5 -6
  111. data/tests/shared/features/support/selenium.rb +10 -0
  112. metadata +149 -184
  113. data/.travis.yml +0 -29
  114. data/Gemfile.ruby218.lock +0 -58
  115. data/tests/rails-3_capybara-1/.ruby-version +0 -1
  116. data/tests/rails-3_capybara-1/Gemfile +0 -20
  117. data/tests/rails-3_capybara-1/Gemfile.lock +0 -182
  118. data/tests/rails-3_capybara-1/Rakefile +0 -18
  119. data/tests/rails-3_capybara-1/app +0 -1
  120. data/tests/rails-3_capybara-1/config.ru +0 -4
  121. data/tests/rails-3_capybara-1/config/application.rb +0 -29
  122. data/tests/rails-3_capybara-1/config/boot.rb +0 -15
  123. data/tests/rails-3_capybara-1/config/cucumber.yml +0 -1
  124. data/tests/rails-3_capybara-1/config/database.yml +0 -1
  125. data/tests/rails-3_capybara-1/config/environment.rb +0 -7
  126. data/tests/rails-3_capybara-1/config/initializers/backtrace_silencers.rb +0 -9
  127. data/tests/rails-3_capybara-1/config/initializers/inflections.rb +0 -12
  128. data/tests/rails-3_capybara-1/config/initializers/mime_types.rb +0 -7
  129. data/tests/rails-3_capybara-1/config/initializers/secret_token.rb +0 -9
  130. data/tests/rails-3_capybara-1/config/initializers/session_store.rb +0 -5
  131. data/tests/rails-3_capybara-1/db +0 -1
  132. data/tests/rails-3_capybara-1/features/shared +0 -1
  133. data/tests/rails-3_capybara-1/features/support/env.rb +0 -65
  134. data/tests/rails-3_capybara-1/features/support/selenium.rb +0 -3
  135. data/tests/rails-3_capybara-1/public +0 -1
  136. data/tests/rails-3_capybara-1/script/rails +0 -6
  137. data/tests/rails-3_capybara-2/.ruby-version +0 -1
  138. data/tests/rails-3_capybara-2/Gemfile +0 -21
  139. data/tests/rails-3_capybara-2/Gemfile.lock +0 -191
  140. data/tests/rails-3_capybara-2/Rakefile +0 -1
  141. data/tests/rails-3_capybara-2/app +0 -1
  142. data/tests/rails-3_capybara-2/config +0 -1
  143. data/tests/rails-3_capybara-2/config.ru +0 -1
  144. data/tests/rails-3_capybara-2/db +0 -1
  145. data/tests/rails-3_capybara-2/features +0 -1
  146. data/tests/rails-3_capybara-2/public +0 -1
  147. data/tests/rails-3_capybara-2/script +0 -1
  148. data/tests/rails-4_capybara-3/config/routes.rb +0 -1
  149. data/tests/rails-4_capybara-3/features/support/paths.rb +0 -1
  150. data/tests/rails-4_capybara-3/features/support/selectors.rb +0 -1
  151. data/tests/rails-4_capybara-3/features/support/selenium.rb +0 -3
  152. data/tests/rails-4_capybara-3/script/cucumber +0 -10
  153. 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: 64749212dae1262a16bb92a588740444cf7ede78c5980fbdf15f66271a4b081d
4
- data.tar.gz: 7384baaed65e17289ff4d4c52874e1c257b315b0e9026fac51bbea9a414f4141
3
+ metadata.gz: 06fe5aa45812c755a6f7b875be6fd48a9c17e134a059aaec4f18d7777f4e88ca
4
+ data.tar.gz: 5612118b301015088b9b9702aaf77d5b1e140ae03e785d2ad840c7bc5805c3d8
5
5
  SHA512:
6
- metadata.gz: e06ba20e5252696bd8ce7aecb6f3a6f9f21eb16c3e2f7ba2cb6223bdfdfdf1cb05c34ada79e06bcd94631ea7288e802fab3f9cce98f8d59d34f7b0b9117300c3
7
- data.tar.gz: d09e69ad26c4e76a09bfaa44989bcd870b1eb160de410be081bf0d40889e3a7ffc901e02c7e208538e8c92719752a3cb7fa396a9f7dada600c257dcbcf72fef3
6
+ metadata.gz: 39507ac68849f59b244bfe7555654aba0b8371d62fdfbb70dcf186713b2458b300a47a05c66c3f6b78183d35313914df60c2b2197ec0ba688f1b82d01fec34cd
7
+ data.tar.gz: a6f5033b9f9d952c7fed05fd38ec6a2e6b72c6ad1e7eadae2311491ff0342ce84afe60015ec81b950a4b04fbe01597e277deec95a929da32b2eadaf4e5f5c4c3
@@ -0,0 +1,42 @@
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: 3.0.0
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
+ - ruby: 3.0.0
28
+ gemfile: Gemfile.ruby300
29
+ env:
30
+ BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ - name: Install ruby
34
+ uses: ruby/setup-ruby@v1
35
+ with:
36
+ ruby-version: "${{ matrix.ruby }}"
37
+ - name: Bundle
38
+ run: |
39
+ gem install bundler:1.17.3
40
+ bundle install --no-deployment
41
+ - name: Run tests
42
+ run: bundle exec rake matrix:single_test[${{ matrix.gemfile }},${{ matrix.ruby }}]
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.5
1
+ 3.0.0
data/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@ 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.1.1
7
+ - The step `I open .. in a new browser tab` is now using the `noopener` option (see issue [#174])
8
+
9
+ ## 4.1.0
10
+
11
+ - New steps:
12
+ - When ... inside the ... iframe
13
+
14
+ - New steps only available for Capybara 3+:
15
+ - When I switch to the ... iframe
16
+ - When I switch back to the whole page
17
+ - The I switch back to the whole page step does not work reliably with Capybara 2 and lead to StaleReferenceErrors, therefore we decided to not make these steps available for Capybara 2.
18
+
19
+ - Small improvements:
20
+ - Trying to match against unsupported email headers will raise an error. Supported headers are "To", "CC", "BCC", "From", "Reply-To", "Subject", "Attachments"
21
+ - It's now possible to have indented header lines in email steps.
22
+ - If there's not an explicit text part in a mail, Spreewald determines if the email body is HTML or plaintext and converts it to plaintext accordingly.
23
+
24
+ ## 4.0.0
25
+
26
+ - Dropped support for capybara 1, Ruby 2.1 and Rails 3.2.
27
+
28
+ ## 3.0.3
29
+
30
+ - 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))
31
+
32
+ ## 3.0.2
33
+
34
+ - Introduce wildcard for the beginning of a line. (see issue [#155](https://github.com/makandra/spreewald/issues/155))
35
+ - This will allow you to check for a specific sentence inside the body
36
+
37
+ ## 3.0.1
38
+
39
+ - Fix deduplication of linebreaks for html mails in mail finder. (see issue [#153](https://github.com/makandra/spreewald/issues/153))
40
+
6
41
  ## 3.0.0
7
42
 
8
43
  ### Breaking changes
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.3
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,7 +64,10 @@ 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
64
- 1.17.3
73
+ 2.2.4
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
@@ -1,7 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ruby '3.0.0'
4
+
5
+ gem 'rake'
3
6
  gem 'rspec'
4
- gem 'cucumber', '<3'
7
+ gem 'cucumber'
5
8
  gem 'aruba'
6
9
 
7
10
  gem 'gemika'
11
+ gem 'mail'
12
+ gem 'nokogiri'
@@ -0,0 +1,108 @@
1
+ GEM
2
+ remote: https://rubygems.org/
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)
11
+ childprocess (>= 2.0, < 5.0)
12
+ contracts (~> 0.16.0)
13
+ cucumber (>= 2.4, < 6.0)
14
+ rspec-expectations (~> 3.4)
15
+ thor (~> 1.0)
16
+ builder (3.2.4)
17
+ childprocess (4.0.0)
18
+ concurrent-ruby (1.1.8)
19
+ contracts (0.16.0)
20
+ cucumber (5.3.0)
21
+ 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)
29
+ diff-lcs (~> 1.4, >= 1.4.4)
30
+ 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)
51
+ 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)
56
+ mail (2.7.1)
57
+ mini_mime (>= 0.1.1)
58
+ middleware (0.1.0)
59
+ mini_mime (1.0.3)
60
+ minitest (5.14.4)
61
+ multi_test (0.1.2)
62
+ nokogiri (1.11.2-x86_64-linux)
63
+ racc (~> 1.4)
64
+ protobuf-cucumber (3.10.8)
65
+ activesupport (>= 3.2)
66
+ middleware
67
+ thor
68
+ thread_safe
69
+ racc (1.5.2)
70
+ rake (13.0.3)
71
+ rspec (3.10.0)
72
+ rspec-core (~> 3.10.0)
73
+ rspec-expectations (~> 3.10.0)
74
+ rspec-mocks (~> 3.10.0)
75
+ rspec-core (3.10.1)
76
+ rspec-support (~> 3.10.0)
77
+ rspec-expectations (3.10.1)
78
+ diff-lcs (>= 1.2.0, < 2.0)
79
+ rspec-support (~> 3.10.0)
80
+ rspec-mocks (3.10.2)
81
+ diff-lcs (>= 1.2.0, < 2.0)
82
+ rspec-support (~> 3.10.0)
83
+ rspec-support (3.10.2)
84
+ sys-uname (1.2.2)
85
+ ffi (~> 1.1)
86
+ 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
+
92
+ PLATFORMS
93
+ x86_64-linux
94
+
95
+ DEPENDENCIES
96
+ aruba
97
+ cucumber
98
+ gemika
99
+ mail
100
+ nokogiri
101
+ rake
102
+ rspec
103
+
104
+ RUBY VERSION
105
+ ruby 3.0.0p0
106
+
107
+ BUNDLED WITH
108
+ 2.2.3
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
 
@@ -237,7 +237,9 @@ the step definitions.
237
237
 
238
238
  """
239
239
 
240
- 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.
241
243
 
242
244
 
243
245
  * **When I follow the (first|second|third)? link in the e?mail**
@@ -265,6 +267,42 @@ the step definitions.
265
267
  This uses the same syntax as `Then an email should have been sent with:`
266
268
 
267
269
 
270
+ ### frame_steps.rb
271
+
272
+ * **When ... inside the ... iframe**
273
+
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.
304
+
305
+
268
306
  ### session_steps.rb
269
307
 
270
308
  * **When ... in the browser session "..."**
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 --publish-quiet"),
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 --publish-quiet"
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