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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +40 -0
- data/CHANGELOG.md +45 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/Gemfile.ruby245 +3 -0
- data/Gemfile.ruby245.lock +10 -1
- data/Gemfile.ruby266 +3 -0
- data/Gemfile.ruby266.lock +12 -2
- data/README.md +40 -32
- data/Rakefile +34 -19
- data/features/binary.feature +2 -2
- data/features/support/step_definitions/custom_steps.rb +10 -0
- data/lib/spreewald.rb +1 -0
- data/lib/spreewald/development_steps.rb +1 -8
- data/lib/spreewald/email_steps.rb +3 -43
- data/lib/spreewald/frame_steps.rb +77 -0
- data/lib/spreewald/web_steps.rb +17 -61
- data/lib/spreewald_support/mail_finder.rb +12 -13
- data/lib/spreewald_support/mail_to_plaintext_converter.rb +42 -0
- data/lib/spreewald_support/unsupported_email_header.rb +22 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/spec/spreewald_support/mail_to_plaintext_converter_spec.rb +60 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Gemfile +1 -1
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Gemfile.lock +14 -16
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/README.rdoc +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/Rakefile +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/app +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/bundle +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/rails +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/rake +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/bin/setup +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config.ru +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/application.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/boot.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/cucumber.yml +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/database.yml +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environment.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environments/development.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/environments/test.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/backtrace_silencers.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/cookies_serializer.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/filter_parameter_logging.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/inflections.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/mime_types.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/session_store.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/silence_deprecation_warnings.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/to_time_preserves_timezone.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/initializers/wrap_parameters.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/locales/en.yml +0 -0
- data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/config/routes.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/config/secrets.yml +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/db +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/browser_tab_steps.feature +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/development_steps.feature +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/email_steps.feature +0 -0
- data/tests/rails-4_capybara-2/features/iframe_steps.feature +1 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/overriding.feature +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/session_steps.feature +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/step_definitions/overriding_steps.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/step_definitions/test_steps.rb +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/support/env.rb +0 -0
- data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/features/support/paths.rb +0 -0
- data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/features/support/selectors.rb +0 -0
- data/tests/rails-4_capybara-2/features/support/selenium.rb +1 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/table_steps.feature +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/time_steps.feature +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/features/web_steps.feature +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/lib/tasks/cucumber.rake +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/log/.keep +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/404.html +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/422.html +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/500.html +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/favicon.ico +0 -0
- data/tests/{rails-4_capybara-3 → rails-4_capybara-2}/public/fixture_files +0 -0
- data/tests/{rails-3_capybara-1 → rails-4_capybara-2}/script/cucumber +0 -0
- data/tests/rails-6_capybara-3/Gemfile.lock +2 -2
- data/tests/rails-6_capybara-3/app/mailers/spreewald_mailer.rb +16 -0
- data/tests/rails-6_capybara-3/features/iframe_steps.feature +1 -0
- data/tests/rails-6_capybara-3/features/support/selenium.rb +1 -0
- data/tests/shared/app/controllers/emails_controller.rb +20 -0
- data/tests/shared/app/controllers/iframes_controller.rb +11 -0
- data/tests/shared/app/controllers/static_pages_controller.rb +12 -8
- data/tests/shared/app/models/mailer.rb +32 -0
- data/tests/shared/app/views/forms/checkbox_form.html.haml +3 -0
- data/tests/shared/app/views/forms/disabled_elements.html.haml +1 -0
- data/tests/shared/app/views/forms/form1.html.haml +4 -1
- data/tests/shared/app/views/forms/invalid_form.html.haml +3 -0
- data/tests/shared/app/views/iframes/iframe_1_content.haml +12 -0
- data/tests/shared/app/views/iframes/iframe_2_content.haml +12 -0
- data/tests/shared/app/views/mailer/html_email_for_failed_test_without_header.haml +5 -0
- data/tests/shared/app/views/mailer/html_email_for_successful_test_without_header.haml +7 -0
- data/tests/shared/app/views/mailer/text_email_for_failed_test_without_header.text.erb +1 -0
- data/tests/shared/app/views/mailer/text_email_for_successful_test_without_header.text.erb +3 -0
- data/tests/shared/app/views/static_pages/iframe.haml +3 -0
- data/tests/shared/config/routes.rb +8 -0
- data/tests/shared/features/shared/email_steps.feature +172 -35
- data/tests/shared/features/shared/iframe_steps.feature +38 -0
- data/tests/shared/features/shared/step_definitions/test_steps.rb +5 -6
- data/tests/shared/features/shared/web_steps.feature +15 -10
- data/tests/shared/features/support/selenium.rb +10 -0
- metadata +137 -186
- data/.travis.yml +0 -29
- data/Gemfile.ruby218 +0 -7
- data/Gemfile.ruby218.lock +0 -58
- data/lib/spreewald/file_attachment_steps.rb +0 -22
- data/lib/spreewald/timecop_steps.rb +0 -9
- data/tests/rails-3_capybara-1/.ruby-version +0 -1
- data/tests/rails-3_capybara-1/Gemfile +0 -20
- data/tests/rails-3_capybara-1/Gemfile.lock +0 -182
- data/tests/rails-3_capybara-1/Rakefile +0 -18
- data/tests/rails-3_capybara-1/app +0 -1
- data/tests/rails-3_capybara-1/config.ru +0 -4
- data/tests/rails-3_capybara-1/config/application.rb +0 -29
- data/tests/rails-3_capybara-1/config/boot.rb +0 -15
- data/tests/rails-3_capybara-1/config/cucumber.yml +0 -1
- data/tests/rails-3_capybara-1/config/database.yml +0 -1
- data/tests/rails-3_capybara-1/config/environment.rb +0 -7
- data/tests/rails-3_capybara-1/config/initializers/backtrace_silencers.rb +0 -9
- data/tests/rails-3_capybara-1/config/initializers/inflections.rb +0 -12
- data/tests/rails-3_capybara-1/config/initializers/mime_types.rb +0 -7
- data/tests/rails-3_capybara-1/config/initializers/secret_token.rb +0 -9
- data/tests/rails-3_capybara-1/config/initializers/session_store.rb +0 -5
- data/tests/rails-3_capybara-1/db +0 -1
- data/tests/rails-3_capybara-1/features/shared +0 -1
- data/tests/rails-3_capybara-1/features/support/env.rb +0 -65
- data/tests/rails-3_capybara-1/features/support/selenium.rb +0 -3
- data/tests/rails-3_capybara-1/public +0 -1
- data/tests/rails-3_capybara-1/script/rails +0 -6
- data/tests/rails-3_capybara-2/.ruby-version +0 -1
- data/tests/rails-3_capybara-2/Gemfile +0 -21
- data/tests/rails-3_capybara-2/Gemfile.lock +0 -191
- data/tests/rails-3_capybara-2/Rakefile +0 -1
- data/tests/rails-3_capybara-2/app +0 -1
- data/tests/rails-3_capybara-2/config +0 -1
- data/tests/rails-3_capybara-2/config.ru +0 -1
- data/tests/rails-3_capybara-2/db +0 -1
- data/tests/rails-3_capybara-2/features +0 -1
- data/tests/rails-3_capybara-2/public +0 -1
- data/tests/rails-3_capybara-2/script +0 -1
- data/tests/rails-4_capybara-3/config/routes.rb +0 -1
- data/tests/rails-4_capybara-3/features/support/paths.rb +0 -1
- data/tests/rails-4_capybara-3/features/support/selectors.rb +0 -1
- data/tests/rails-4_capybara-3/features/support/selenium.rb +0 -3
- data/tests/rails-4_capybara-3/script/cucumber +0 -10
- 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b97388391eda8359eab973a0a92896ee7d10e7fc4db749b7f22fb326eddf268
|
|
4
|
+
data.tar.gz: 77aea5e617594133107957b887d5f4848a91532fc46b835b1b5af07164f652e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
##
|
|
7
|
-
|
|
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
|
-
##
|
|
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
|
-
##
|
|
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
data/Gemfile.lock
CHANGED
data/Gemfile.ruby245
CHANGED
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.
|
|
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
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.
|
|
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.
|
|
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
|
|
22
|
+
## Supported versions
|
|
23
23
|
|
|
24
|
-
Spreewald
|
|
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.
|
|
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
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
-
###
|
|
270
|
+
### frame_steps.rb
|
|
273
271
|
|
|
274
|
-
* **
|
|
272
|
+
* **When ... inside the ... iframe**
|
|
275
273
|
|
|
276
|
-
|
|
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 "..."
|
|
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
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
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
|
data/features/binary.feature
CHANGED
|
@@ -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
|
|
243
|
+
Then the output should contain /Spreewald \d./
|
|
244
244
|
|
|
245
245
|
When I run `spreewald -v`
|
|
246
|
-
Then the output should contain
|
|
246
|
+
Then the output should contain /Spreewald \d./
|