spreewald 1.12.6 → 2.0.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/CHANGELOG.md +5 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +18 -0
- data/README.md +4 -0
- data/lib/spreewald/email_steps.rb +11 -11
- data/lib/spreewald/table_steps.rb +2 -2
- data/lib/spreewald/web_steps.rb +42 -42
- data/lib/spreewald_support/mail_finder.rb +2 -1
- data/lib/spreewald_support/version.rb +1 -1
- data/lib/spreewald_support/web_steps_helpers.rb +8 -8
- data/spreewald.gemspec +1 -1
- data/tests/rails-3_capybara-1/Gemfile.lock +6 -1
- data/tests/rails-3_capybara-2/Gemfile.lock +6 -1
- data/tests/rails-4_capybara-3/Gemfile.lock +6 -1
- data/tests/rails-4_capybara-3/features/email_steps.feature +102 -11
- data/tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb +1 -1
- data/tests/rails-4_capybara-3/features/web_steps.feature +33 -3
- data/tests/shared/app/controllers/forms_controller.rb +3 -0
- data/tests/shared/app/models/mailer.rb +9 -4
- data/tests/shared/app/views/emails/send_email.haml +0 -0
- data/tests/shared/app/views/forms/form1.html.haml +4 -0
- data/tests/shared/app/views/forms/invalid_form.html.haml +10 -0
- data/tests/shared/app/views/mailer/email.haml +4 -0
- data/tests/shared/db/test.sqlite3 +0 -0
- data/tests/shared/features/shared/email_steps.feature +102 -11
- data/tests/shared/features/shared/step_definitions/overriding_steps.rb +1 -1
- data/tests/shared/features/shared/web_steps.feature +33 -3
- metadata +22 -16
File without changes
|
@@ -23,3 +23,7 @@
|
|
23
23
|
= label_tag 'empty_control', 'Empty control'
|
24
24
|
= text_field_tag 'empty_control'
|
25
25
|
|
26
|
+
= label_tag 'radio_button_control_radio1', 'Radio 1'
|
27
|
+
= radio_button_tag 'radio_button_control', 'radio1'
|
28
|
+
= label_tag 'radio_button_control_radio2', 'Radio 2'
|
29
|
+
= radio_button_tag 'radio_button_control', 'radio2'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= form_tag do
|
2
|
+
.form-group.field_with_errors
|
3
|
+
= label_tag 'text_control', 'Text control'
|
4
|
+
= text_field_tag 'text_control', 'Text control value'
|
5
|
+
.form-group.field_with_errors
|
6
|
+
= label_tag 'textarea_control', 'Textarea control'
|
7
|
+
= text_area_tag 'textarea_control', "Textarea control line 1\nTextarea control line 2\n"
|
8
|
+
.form-group
|
9
|
+
= label_tag 'empty_textarea_control', 'Empty textarea control'
|
10
|
+
= text_area_tag 'empty_textarea_control', ""
|
Binary file
|
@@ -13,7 +13,7 @@ Feature: Test Spreewald's email steps
|
|
13
13
|
Scenario: /^I should see "([^\"]*)" in the e?mail$/
|
14
14
|
When I go to "/emails/send_email"
|
15
15
|
Then the following step should succeed:
|
16
|
-
| I should see "
|
16
|
+
| I should see "Body" in the email |
|
17
17
|
But the following step should fail:
|
18
18
|
| I should see "XYZ" in the email |
|
19
19
|
|
@@ -23,7 +23,7 @@ Feature: Test Spreewald's email steps
|
|
23
23
|
|
24
24
|
# Test without body
|
25
25
|
Then the following multiline step should succeed:
|
26
|
-
|
26
|
+
"""
|
27
27
|
Then an email should have been sent with:
|
28
28
|
'''
|
29
29
|
From: from@example.com
|
@@ -43,7 +43,10 @@ Feature: Test Spreewald's email steps
|
|
43
43
|
To: to@example.com
|
44
44
|
Subject: SUBJECT
|
45
45
|
|
46
|
-
|
46
|
+
Body
|
47
|
+
with
|
48
|
+
line
|
49
|
+
breaks
|
47
50
|
'''
|
48
51
|
"""
|
49
52
|
|
@@ -57,7 +60,10 @@ Feature: Test Spreewald's email steps
|
|
57
60
|
To: to@example.com
|
58
61
|
Subject: SUBJECT
|
59
62
|
|
60
|
-
|
63
|
+
Body
|
64
|
+
with
|
65
|
+
line
|
66
|
+
breaks
|
61
67
|
'''
|
62
68
|
"""
|
63
69
|
|
@@ -71,12 +77,15 @@ Feature: Test Spreewald's email steps
|
|
71
77
|
To: to@example.com
|
72
78
|
Subject: SUBJECT
|
73
79
|
|
74
|
-
|
80
|
+
Body
|
81
|
+
with
|
82
|
+
line
|
83
|
+
breaks
|
75
84
|
'''
|
76
85
|
"""
|
77
86
|
# Test with incorrect To header
|
78
87
|
Then the following multiline step should fail:
|
79
|
-
|
88
|
+
"""
|
80
89
|
Then an email should have been sent with:
|
81
90
|
'''
|
82
91
|
From: from@example.com
|
@@ -84,13 +93,16 @@ Feature: Test Spreewald's email steps
|
|
84
93
|
To: other-to@example.com
|
85
94
|
Subject: SUBJECT
|
86
95
|
|
87
|
-
|
96
|
+
Body
|
97
|
+
with
|
98
|
+
line
|
99
|
+
breaks
|
88
100
|
'''
|
89
101
|
"""
|
90
102
|
|
91
103
|
# Test with incorrect Subject header
|
92
104
|
Then the following multiline step should fail:
|
93
|
-
|
105
|
+
"""
|
94
106
|
Then an email should have been sent with:
|
95
107
|
'''
|
96
108
|
From: from@example.com
|
@@ -98,7 +110,10 @@ Feature: Test Spreewald's email steps
|
|
98
110
|
To: to@example.com
|
99
111
|
Subject: OTHER-SUBJECT
|
100
112
|
|
101
|
-
|
113
|
+
Body
|
114
|
+
with
|
115
|
+
line
|
116
|
+
breaks
|
102
117
|
'''
|
103
118
|
"""
|
104
119
|
|
@@ -112,7 +127,10 @@ Feature: Test Spreewald's email steps
|
|
112
127
|
To: to@example.com
|
113
128
|
Subject: SUBJECT
|
114
129
|
|
115
|
-
|
130
|
+
Other body
|
131
|
+
with
|
132
|
+
line
|
133
|
+
breaks
|
116
134
|
'''
|
117
135
|
"""
|
118
136
|
|
@@ -126,8 +144,81 @@ Feature: Test Spreewald's email steps
|
|
126
144
|
To: to@example.com
|
127
145
|
Subject: SUBJECT
|
128
146
|
|
129
|
-
|
147
|
+
Body
|
148
|
+
with
|
149
|
+
line
|
150
|
+
breaks
|
130
151
|
|
131
152
|
MORE-BODY
|
132
153
|
'''
|
133
154
|
"""
|
155
|
+
|
156
|
+
Scenario: /^(an|no) e?mail should have been sent((?: |and|with|from "[^"]+"|bcc "[^"]+"|cc "[^"]+"|to "[^"]+"|the subject "[^"]+"|the body "[^"]+"|the attachments "[^"]+")+)$/
|
157
|
+
When I go to "/emails/send_email"
|
158
|
+
|
159
|
+
# Test with correct conditions
|
160
|
+
Then the following multiline step should succeed:
|
161
|
+
"""
|
162
|
+
Then an email should have been sent from "from@example.com" to "to@example.com" cc "cc@example.com" bcc "bcc@example.com" and the subject "SUBJECT" and the attachments "attached_file.pdf"
|
163
|
+
"""
|
164
|
+
|
165
|
+
# Test with wrong conditions
|
166
|
+
Then the following multiline step should fail:
|
167
|
+
"""
|
168
|
+
Then an email should have been sent from "from@example.com" to "to@example.com" cc "cc@example.com" bcc "wrong_bcc@example.com" and the subject "SUBJECT" and the attachments "attached_file.pdf"
|
169
|
+
"""
|
170
|
+
|
171
|
+
Scenario: /^that e?mail should have the following lines in the body:$/
|
172
|
+
When I go to "/emails/send_email"
|
173
|
+
Then an email should have been sent with:
|
174
|
+
"""
|
175
|
+
From: from@example.com
|
176
|
+
"""
|
177
|
+
|
178
|
+
# Test with correct body lines
|
179
|
+
Then the following multiline step should succeed:
|
180
|
+
"""
|
181
|
+
Then that email should have the following lines in the body:
|
182
|
+
'''
|
183
|
+
with
|
184
|
+
line
|
185
|
+
'''
|
186
|
+
"""
|
187
|
+
|
188
|
+
# Test with wrong body lines
|
189
|
+
Then the following multiline step should fail:
|
190
|
+
"""
|
191
|
+
Then that email should have the following lines in the body:
|
192
|
+
'''
|
193
|
+
wrong
|
194
|
+
line
|
195
|
+
'''
|
196
|
+
"""
|
197
|
+
|
198
|
+
|
199
|
+
Scenario: /^that e?mail should have the following body:$/
|
200
|
+
When I go to "/emails/send_email"
|
201
|
+
Then an email should have been sent with:
|
202
|
+
"""
|
203
|
+
From: from@example.com
|
204
|
+
"""
|
205
|
+
|
206
|
+
# Test with correct body lines
|
207
|
+
Then the following multiline step should succeed:
|
208
|
+
"""
|
209
|
+
Then that email should have the following body:
|
210
|
+
'''
|
211
|
+
with
|
212
|
+
line
|
213
|
+
'''
|
214
|
+
"""
|
215
|
+
|
216
|
+
# Test with wrong body lines
|
217
|
+
Then the following multiline step should fail:
|
218
|
+
"""
|
219
|
+
Then that email should have the following body:
|
220
|
+
'''
|
221
|
+
wrong
|
222
|
+
line
|
223
|
+
'''
|
224
|
+
"""
|
@@ -3,6 +3,7 @@ Feature: Web steps
|
|
3
3
|
Scenario: /^the "([^"]*)" field should (not )?contain "([^"]*)"$/
|
4
4
|
When I go to "/forms/form1"
|
5
5
|
Then the "Text control" field should contain "Text control value"
|
6
|
+
Then the "Text control" field should not contain "false text"
|
6
7
|
Then the "Select control" field should contain "Label 2"
|
7
8
|
Then the "Select control without selection" field should contain "Label 1"
|
8
9
|
Then the "Textarea control" field should contain "Textarea control value"
|
@@ -20,11 +21,29 @@ Feature: Web steps
|
|
20
21
|
Textarea control line 1
|
21
22
|
Textarea control line 2
|
22
23
|
"""
|
24
|
+
Then the "Textarea control" field should not contain:
|
25
|
+
"""
|
26
|
+
Textarea control wrong line 1
|
27
|
+
Textarea control wrong line 2
|
28
|
+
"""
|
23
29
|
Then the "Empty textarea control" field should contain:
|
24
30
|
"""
|
25
31
|
"""
|
26
32
|
|
27
33
|
|
34
|
+
Scenario: /^the "([^\"]*)" field should( not)? have an error$/
|
35
|
+
When I go to "/forms/invalid_form"
|
36
|
+
Then the "Text control" field should have an error
|
37
|
+
Then the "Textarea control" field should have an error
|
38
|
+
Then the "Textarea control" field should have an error
|
39
|
+
Then the "Empty textarea control" field should not have an error
|
40
|
+
|
41
|
+
|
42
|
+
Scenario: /^the "([^"]*)" field should have no error$/
|
43
|
+
When I go to "/forms/invalid_form"
|
44
|
+
Then the "Empty textarea control" field should have no error
|
45
|
+
|
46
|
+
|
28
47
|
Scenario: /^I should see a form with the following values:$/
|
29
48
|
When I go to "/forms/form1"
|
30
49
|
Then I should see a form with the following values:
|
@@ -47,7 +66,18 @@ Feature: Web steps
|
|
47
66
|
Then nothing should be selected for "Select control with blank option"
|
48
67
|
Then nothing should be selected for "Select control with blank selection"
|
49
68
|
|
50
|
-
|
69
|
+
Scenario: /^the radio button "([^"]*)" should( not)? be (?:checked|selected)$/
|
70
|
+
When I go to "/forms/form1"
|
71
|
+
Then the radio button "Radio 1" should not be selected
|
72
|
+
Then the radio button "Radio 2" should not be selected
|
73
|
+
When I choose "Radio 1"
|
74
|
+
Then the radio button "Radio 1" should be selected
|
75
|
+
Then the radio button "Radio 2" should not be selected
|
76
|
+
When I choose "Radio 2"
|
77
|
+
Then the radio button "Radio 1" should not be selected
|
78
|
+
Then the radio button "Radio 2" should be selected
|
79
|
+
|
80
|
+
|
51
81
|
Scenario: /^I go back$/
|
52
82
|
Given I go to "/static_pages/link_to_home"
|
53
83
|
And I follow "Home"
|
@@ -103,7 +133,7 @@ Feature: Web steps
|
|
103
133
|
|
104
134
|
Scenario: /^Then (the tag )?"..." should( not)? be visible$/
|
105
135
|
When I go to "/static_pages/visibility"
|
106
|
-
Then "hidden ümläüt" should
|
136
|
+
Then "hidden ümläüt" should be hidden
|
107
137
|
And "visible ümläüt" should be visible
|
108
138
|
And a hidden string with quotes should not be visible
|
109
139
|
And a visible string with quotes should be visible
|
@@ -113,7 +143,7 @@ Feature: Web steps
|
|
113
143
|
@javascript
|
114
144
|
Scenario: /^Then (the tag )?"..." should( not)? be visible$/ with javascript
|
115
145
|
When I go to "/static_pages/visibility"
|
116
|
-
Then "hidden ümläüt" should
|
146
|
+
Then "hidden ümläüt" should be hidden
|
117
147
|
And "visible ümläüt" should be visible
|
118
148
|
And a hidden string with quotes should not be visible
|
119
149
|
And a visible string with quotes should be visible
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.3.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +108,6 @@ dependencies:
|
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: 0.10.2
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rspec
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 3.4.0
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 3.4.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: geordi
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,11 +257,14 @@ files:
|
|
257
257
|
- tests/shared/app/controllers/static_pages_controller.rb
|
258
258
|
- tests/shared/app/controllers/tables_controller.rb
|
259
259
|
- tests/shared/app/models/mailer.rb
|
260
|
+
- tests/shared/app/views/emails/send_email.haml
|
260
261
|
- tests/shared/app/views/forms/checkbox_form.html.haml
|
261
262
|
- tests/shared/app/views/forms/form1.html.haml
|
262
263
|
- tests/shared/app/views/forms/form2.html.haml
|
264
|
+
- tests/shared/app/views/forms/invalid_form.html.haml
|
263
265
|
- tests/shared/app/views/forms/select_fields.html.haml
|
264
266
|
- tests/shared/app/views/layouts/application.html.haml
|
267
|
+
- tests/shared/app/views/mailer/email.haml
|
265
268
|
- tests/shared/app/views/static_pages/click_on.html.haml
|
266
269
|
- tests/shared/app/views/static_pages/home.html.haml
|
267
270
|
- tests/shared/app/views/static_pages/link_to_home.html.haml
|
@@ -392,11 +395,14 @@ test_files:
|
|
392
395
|
- tests/shared/app/controllers/static_pages_controller.rb
|
393
396
|
- tests/shared/app/controllers/tables_controller.rb
|
394
397
|
- tests/shared/app/models/mailer.rb
|
398
|
+
- tests/shared/app/views/emails/send_email.haml
|
395
399
|
- tests/shared/app/views/forms/checkbox_form.html.haml
|
396
400
|
- tests/shared/app/views/forms/form1.html.haml
|
397
401
|
- tests/shared/app/views/forms/form2.html.haml
|
402
|
+
- tests/shared/app/views/forms/invalid_form.html.haml
|
398
403
|
- tests/shared/app/views/forms/select_fields.html.haml
|
399
404
|
- tests/shared/app/views/layouts/application.html.haml
|
405
|
+
- tests/shared/app/views/mailer/email.haml
|
400
406
|
- tests/shared/app/views/static_pages/click_on.html.haml
|
401
407
|
- tests/shared/app/views/static_pages/home.html.haml
|
402
408
|
- tests/shared/app/views/static_pages/link_to_home.html.haml
|