cucumber 3.2.0 → 4.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 +166 -19
- data/CONTRIBUTING.md +2 -18
- data/README.md +4 -5
- data/bin/cucumber +1 -1
- data/lib/autotest/cucumber_mixin.rb +34 -39
- data/lib/cucumber/cli/configuration.rb +5 -5
- data/lib/cucumber/cli/main.rb +12 -12
- data/lib/cucumber/cli/options.rb +62 -71
- data/lib/cucumber/cli/profile_loader.rb +49 -26
- data/lib/cucumber/configuration.rb +31 -23
- data/lib/cucumber/constantize.rb +2 -5
- data/lib/cucumber/deprecate.rb +31 -7
- data/lib/cucumber/errors.rb +5 -7
- data/lib/cucumber/events/envelope.rb +9 -0
- data/lib/cucumber/events/gherkin_source_parsed.rb +11 -0
- data/lib/cucumber/events/hook_test_step_created.rb +13 -0
- data/lib/cucumber/events/step_activated.rb +2 -1
- data/lib/cucumber/events/test_case_created.rb +13 -0
- data/lib/cucumber/events/test_case_ready.rb +12 -0
- data/lib/cucumber/events/test_step_created.rb +13 -0
- data/lib/cucumber/events/undefined_parameter_type.rb +10 -0
- data/lib/cucumber/events.rb +13 -6
- data/lib/cucumber/file_specs.rb +6 -6
- data/lib/cucumber/filters/activate_steps.rb +5 -3
- data/lib/cucumber/filters/broadcast_test_case_ready_event.rb +12 -0
- data/lib/cucumber/filters/prepare_world.rb +5 -9
- data/lib/cucumber/filters/quit.rb +1 -3
- data/lib/cucumber/filters/tag_limits/verifier.rb +2 -4
- data/lib/cucumber/filters.rb +1 -0
- data/lib/cucumber/formatter/ansicolor.rb +40 -45
- data/lib/cucumber/formatter/ast_lookup.rb +165 -0
- data/lib/cucumber/formatter/backtrace_filter.rb +9 -8
- data/lib/cucumber/formatter/console.rb +58 -66
- data/lib/cucumber/formatter/console_counts.rb +4 -9
- data/lib/cucumber/formatter/console_issues.rb +6 -3
- data/lib/cucumber/formatter/duration.rb +1 -1
- data/lib/cucumber/formatter/duration_extractor.rb +3 -1
- data/lib/cucumber/formatter/errors.rb +6 -0
- data/lib/cucumber/formatter/fanout.rb +2 -0
- data/lib/cucumber/formatter/html.rb +11 -598
- data/lib/cucumber/formatter/http_io.rb +1 -1
- data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -1
- data/lib/cucumber/formatter/interceptor.rb +8 -28
- data/lib/cucumber/formatter/io.rb +1 -1
- data/lib/cucumber/formatter/json.rb +101 -115
- data/lib/cucumber/formatter/junit.rb +56 -56
- data/lib/cucumber/formatter/message.rb +22 -0
- data/lib/cucumber/formatter/message_builder.rb +255 -0
- data/lib/cucumber/formatter/pretty.rb +359 -153
- data/lib/cucumber/formatter/progress.rb +30 -32
- data/lib/cucumber/formatter/query/hook_by_test_step.rb +31 -0
- data/lib/cucumber/formatter/query/pickle_by_test.rb +26 -0
- data/lib/cucumber/formatter/query/pickle_step_by_test_step.rb +26 -0
- data/lib/cucumber/formatter/query/step_definitions_by_test_step.rb +40 -0
- data/lib/cucumber/formatter/query/test_case_started_by_test_case.rb +40 -0
- data/lib/cucumber/formatter/rerun.rb +22 -4
- data/lib/cucumber/formatter/stepdefs.rb +1 -2
- data/lib/cucumber/formatter/steps.rb +2 -3
- data/lib/cucumber/formatter/summary.rb +16 -8
- data/lib/cucumber/formatter/unicode.rb +15 -17
- data/lib/cucumber/formatter/usage.rb +11 -10
- data/lib/cucumber/gherkin/data_table_parser.rb +17 -6
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +13 -17
- data/lib/cucumber/gherkin/formatter/escaping.rb +2 -2
- data/lib/cucumber/gherkin/steps_parser.rb +17 -8
- data/lib/cucumber/glue/dsl.rb +1 -1
- data/lib/cucumber/glue/hook.rb +34 -11
- data/lib/cucumber/glue/invoke_in_world.rb +13 -18
- data/lib/cucumber/glue/proto_world.rb +42 -33
- data/lib/cucumber/glue/registry_and_more.rb +42 -12
- data/lib/cucumber/glue/snippet.rb +23 -22
- data/lib/cucumber/glue/step_definition.rb +42 -19
- data/lib/cucumber/glue/world_factory.rb +1 -1
- data/lib/cucumber/hooks.rb +11 -11
- data/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +1 -1
- data/lib/cucumber/multiline_argument/data_table.rb +97 -64
- data/lib/cucumber/multiline_argument/doc_string.rb +1 -1
- data/lib/cucumber/multiline_argument.rb +4 -6
- data/lib/cucumber/platform.rb +3 -3
- data/lib/cucumber/rake/task.rb +16 -16
- data/lib/cucumber/rspec/disable_option_parser.rb +9 -8
- data/lib/cucumber/running_test_case.rb +2 -53
- data/lib/cucumber/runtime/after_hooks.rb +8 -4
- data/lib/cucumber/runtime/before_hooks.rb +8 -4
- data/lib/cucumber/runtime/for_programming_languages.rb +4 -2
- data/lib/cucumber/runtime/step_hooks.rb +3 -2
- data/lib/cucumber/runtime/support_code.rb +13 -15
- data/lib/cucumber/runtime/user_interface.rb +6 -16
- data/lib/cucumber/runtime.rb +54 -58
- data/lib/cucumber/step_definition_light.rb +4 -3
- data/lib/cucumber/step_definitions.rb +2 -2
- data/lib/cucumber/step_match.rb +12 -11
- data/lib/cucumber/step_match_search.rb +2 -1
- data/lib/cucumber/term/ansicolor.rb +9 -9
- data/lib/cucumber/version +1 -1
- data/lib/cucumber.rb +1 -1
- metadata +221 -77
- data/lib/cucumber/formatter/cucumber.css +0 -286
- data/lib/cucumber/formatter/cucumber.sass +0 -247
- data/lib/cucumber/formatter/hook_query_visitor.rb +0 -42
- data/lib/cucumber/formatter/html_builder.rb +0 -121
- data/lib/cucumber/formatter/inline-js.js +0 -30
- data/lib/cucumber/formatter/jquery-min.js +0 -154
- data/lib/cucumber/formatter/json_pretty.rb +0 -11
- data/lib/cucumber/formatter/legacy_api/adapter.rb +0 -1028
- data/lib/cucumber/formatter/legacy_api/ast.rb +0 -394
- data/lib/cucumber/formatter/legacy_api/results.rb +0 -50
- data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +0 -32
- data/lib/cucumber/step_argument.rb +0 -25
@@ -1,286 +0,0 @@
|
|
1
|
-
/* cucumber.css is generated from cucumber.sass */
|
2
|
-
/* Regenerate with rake sass */
|
3
|
-
body {
|
4
|
-
font-size: 0px;
|
5
|
-
color: white;
|
6
|
-
margin: 0px;
|
7
|
-
padding: 0px;
|
8
|
-
}
|
9
|
-
|
10
|
-
.cucumber, td, th {
|
11
|
-
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
12
|
-
background: white;
|
13
|
-
color: black;
|
14
|
-
}
|
15
|
-
.cucumber #cucumber-header, td #cucumber-header, th #cucumber-header {
|
16
|
-
background: #65c400;
|
17
|
-
color: white;
|
18
|
-
height: 6em;
|
19
|
-
}
|
20
|
-
.cucumber #cucumber-header #expand-collapse p, td #cucumber-header #expand-collapse p, th #cucumber-header #expand-collapse p {
|
21
|
-
float: right;
|
22
|
-
margin: 0 0 0 10px;
|
23
|
-
}
|
24
|
-
.cucumber .scenario h3, td .scenario h3, th .scenario h3, .background h3 {
|
25
|
-
font-size: 11px;
|
26
|
-
padding: 3px;
|
27
|
-
margin: 0;
|
28
|
-
background: #65c400;
|
29
|
-
color: white;
|
30
|
-
font-weight: bold;
|
31
|
-
}
|
32
|
-
|
33
|
-
.background h3 {
|
34
|
-
font-size: 1.2em;
|
35
|
-
background: #666;
|
36
|
-
}
|
37
|
-
|
38
|
-
.cucumber h1, td h1, th h1 {
|
39
|
-
margin: 0px 10px 0px 10px;
|
40
|
-
padding: 10px;
|
41
|
-
font-family: "Lucida Grande", Helvetica, sans-serif;
|
42
|
-
font-size: 2em;
|
43
|
-
position: absolute;
|
44
|
-
}
|
45
|
-
.cucumber h4, td h4, th h4 {
|
46
|
-
margin-bottom: 2px;
|
47
|
-
}
|
48
|
-
.cucumber div.feature, td div.feature, th div.feature {
|
49
|
-
padding: 2px;
|
50
|
-
margin: 0px 10px 5px 10px;
|
51
|
-
}
|
52
|
-
.cucumber div.examples, td div.examples, th div.examples {
|
53
|
-
padding: 0em 0em 0em 1em;
|
54
|
-
}
|
55
|
-
.cucumber .stats, td .stats, th .stats {
|
56
|
-
margin: 2em;
|
57
|
-
}
|
58
|
-
.cucumber .summary ul.features li, td .summary ul.features li, th .summary ul.features li {
|
59
|
-
display: inline;
|
60
|
-
}
|
61
|
-
.cucumber .step_name, td .step_name, th .step_name {
|
62
|
-
float: left;
|
63
|
-
}
|
64
|
-
.cucumber .step_file, td .step_file, th .step_file {
|
65
|
-
text-align: right;
|
66
|
-
color: #999999;
|
67
|
-
}
|
68
|
-
.cucumber .step_file a, td .step_file a, th .step_file a {
|
69
|
-
color: #999999;
|
70
|
-
}
|
71
|
-
.cucumber .scenario_file, td .scenario_file, th .scenario_file {
|
72
|
-
float: right;
|
73
|
-
color: #999999;
|
74
|
-
}
|
75
|
-
.cucumber .tag, td .tag, th .tag {
|
76
|
-
font-weight: bold;
|
77
|
-
color: #246ac1;
|
78
|
-
}
|
79
|
-
.cucumber .backtrace, td .backtrace, th .backtrace {
|
80
|
-
margin-top: 0;
|
81
|
-
margin-bottom: 0;
|
82
|
-
margin-left: 1em;
|
83
|
-
color: black;
|
84
|
-
}
|
85
|
-
.cucumber a, td a, th a {
|
86
|
-
text-decoration: none;
|
87
|
-
color: #be5c00;
|
88
|
-
}
|
89
|
-
.cucumber a:hover, td a:hover, th a:hover {
|
90
|
-
text-decoration: underline;
|
91
|
-
}
|
92
|
-
.cucumber a:visited, td a:visited, th a:visited {
|
93
|
-
font-weight: normal;
|
94
|
-
}
|
95
|
-
.cucumber a div.examples, td a div.examples, th a div.examples {
|
96
|
-
margin: 5px 0px 5px 15px;
|
97
|
-
color: black;
|
98
|
-
}
|
99
|
-
.cucumber .outline table, td .outline table, th .outline table {
|
100
|
-
margin: 0px 0px 5px 10px;
|
101
|
-
}
|
102
|
-
.cucumber table, td table, th table {
|
103
|
-
border-collapse: collapse;
|
104
|
-
}
|
105
|
-
.cucumber table td, td table td, th table td {
|
106
|
-
padding: 3px 3px 3px 5px;
|
107
|
-
}
|
108
|
-
.cucumber table td.failed, .cucumber table td.passed, .cucumber table td.skipped, .cucumber table td.pending, .cucumber table td.undefined, td table td.failed, td table td.passed, td table td.skipped, td table td.pending, td table td.undefined, th table td.failed, th table td.passed, th table td.skipped, th table td.pending, th table td.undefined {
|
109
|
-
padding-left: 18px;
|
110
|
-
padding-right: 10px;
|
111
|
-
}
|
112
|
-
.cucumber table td.failed, td table td.failed, th table td.failed {
|
113
|
-
border-left: 5px solid #c20000;
|
114
|
-
border-bottom: 1px solid #c20000;
|
115
|
-
background: #fffbd3;
|
116
|
-
color: #c20000;
|
117
|
-
}
|
118
|
-
.cucumber table td.passed, td table td.passed, th table td.passed {
|
119
|
-
border-left: 5px solid #65c400;
|
120
|
-
border-bottom: 1px solid #65c400;
|
121
|
-
background: #dbffb4;
|
122
|
-
color: #3d7700;
|
123
|
-
}
|
124
|
-
.cucumber table td.skipped, td table td.skipped, th table td.skipped {
|
125
|
-
border-left: 5px solid aqua;
|
126
|
-
border-bottom: 1px solid aqua;
|
127
|
-
background: #e0ffff;
|
128
|
-
color: #001111;
|
129
|
-
}
|
130
|
-
.cucumber table td.pending, td table td.pending, th table td.pending {
|
131
|
-
border-left: 5px solid #faf834;
|
132
|
-
border-bottom: 1px solid #faf834;
|
133
|
-
background: #fcfb98;
|
134
|
-
color: #131313;
|
135
|
-
}
|
136
|
-
.cucumber table td.undefined, td table td.undefined, th table td.undefined {
|
137
|
-
border-left: 5px solid #faf834;
|
138
|
-
border-bottom: 1px solid #faf834;
|
139
|
-
background: #fcfb98;
|
140
|
-
color: #131313;
|
141
|
-
}
|
142
|
-
.cucumber table td.message, td table td.message, th table td.message {
|
143
|
-
border-left: 5px solid aqua;
|
144
|
-
border-bottom: 1px solid aqua;
|
145
|
-
background: #e0ffff;
|
146
|
-
color: #001111;
|
147
|
-
}
|
148
|
-
.cucumber ol, td ol, th ol {
|
149
|
-
list-style: none;
|
150
|
-
margin: 0px;
|
151
|
-
padding: 0px;
|
152
|
-
}
|
153
|
-
.cucumber ol li.step, td ol li.step, th ol li.step {
|
154
|
-
padding: 3px 3px 3px 18px;
|
155
|
-
margin: 5px 0px 5px 5px;
|
156
|
-
}
|
157
|
-
.cucumber ol li, td ol li, th ol li {
|
158
|
-
margin: 0em 0em 0em 1em;
|
159
|
-
padding: 0em 0em 0em 0.2em;
|
160
|
-
}
|
161
|
-
.cucumber ol li span.param, td ol li span.param, th ol li span.param {
|
162
|
-
font-weight: bold;
|
163
|
-
}
|
164
|
-
.cucumber ol li.failed, td ol li.failed, th ol li.failed {
|
165
|
-
border-left: 5px solid #c20000;
|
166
|
-
border-bottom: 1px solid #c20000;
|
167
|
-
background: #fffbd3;
|
168
|
-
color: #c20000;
|
169
|
-
}
|
170
|
-
.cucumber ol li.passed, td ol li.passed, th ol li.passed {
|
171
|
-
border-left: 5px solid #65c400;
|
172
|
-
border-bottom: 1px solid #65c400;
|
173
|
-
background: #dbffb4;
|
174
|
-
color: #3d7700;
|
175
|
-
}
|
176
|
-
.cucumber ol li.skipped, td ol li.skipped, th ol li.skipped {
|
177
|
-
border-left: 5px solid aqua;
|
178
|
-
border-bottom: 1px solid aqua;
|
179
|
-
background: #e0ffff;
|
180
|
-
color: #001111;
|
181
|
-
}
|
182
|
-
.cucumber ol li.pending, td ol li.pending, th ol li.pending {
|
183
|
-
border-left: 5px solid #faf834;
|
184
|
-
border-bottom: 1px solid #faf834;
|
185
|
-
background: #fcfb98;
|
186
|
-
color: #131313;
|
187
|
-
}
|
188
|
-
.cucumber ol li.undefined, td ol li.undefined, th ol li.undefined {
|
189
|
-
border-left: 5px solid #faf834;
|
190
|
-
border-bottom: 1px solid #faf834;
|
191
|
-
background: #fcfb98;
|
192
|
-
color: #131313;
|
193
|
-
}
|
194
|
-
.cucumber ol li.message, td ol li.message, th ol li.message {
|
195
|
-
border-left: 5px solid aqua;
|
196
|
-
border-bottom: 1px solid aqua;
|
197
|
-
background: #e0ffff;
|
198
|
-
color: #001111;
|
199
|
-
margin-left: 10px;
|
200
|
-
white-space: pre;
|
201
|
-
}
|
202
|
-
.cucumber #summary, td #summary, th #summary {
|
203
|
-
margin: 0px;
|
204
|
-
padding: 5px 10px;
|
205
|
-
text-align: right;
|
206
|
-
top: 0px;
|
207
|
-
right: 0px;
|
208
|
-
float: right;
|
209
|
-
}
|
210
|
-
.cucumber #summary p, td #summary p, th #summary p {
|
211
|
-
margin: 0 0 0 2px;
|
212
|
-
}
|
213
|
-
.cucumber #summary #totals, td #summary #totals, th #summary #totals {
|
214
|
-
font-size: 1.2em;
|
215
|
-
}
|
216
|
-
|
217
|
-
.ruby {
|
218
|
-
font-size: 12px;
|
219
|
-
font-family: monospace;
|
220
|
-
color: white;
|
221
|
-
background: black;
|
222
|
-
padding: 0.1em 0 0.2em 0;
|
223
|
-
}
|
224
|
-
.ruby .keyword {
|
225
|
-
color: #ff6600;
|
226
|
-
}
|
227
|
-
.ruby .constant {
|
228
|
-
color: #339999;
|
229
|
-
}
|
230
|
-
.ruby .attribute {
|
231
|
-
color: white;
|
232
|
-
}
|
233
|
-
.ruby .global {
|
234
|
-
color: white;
|
235
|
-
}
|
236
|
-
.ruby .module {
|
237
|
-
color: white;
|
238
|
-
}
|
239
|
-
.ruby .class {
|
240
|
-
color: white;
|
241
|
-
}
|
242
|
-
.ruby .string {
|
243
|
-
color: #66ff00;
|
244
|
-
}
|
245
|
-
.ruby .ident {
|
246
|
-
color: white;
|
247
|
-
}
|
248
|
-
.ruby .method {
|
249
|
-
color: #ffcc00;
|
250
|
-
}
|
251
|
-
.ruby .number {
|
252
|
-
color: white;
|
253
|
-
}
|
254
|
-
.ruby .char {
|
255
|
-
color: white;
|
256
|
-
}
|
257
|
-
.ruby .comment {
|
258
|
-
color: #9933cc;
|
259
|
-
}
|
260
|
-
.ruby .symbol {
|
261
|
-
color: white;
|
262
|
-
}
|
263
|
-
.ruby .regex {
|
264
|
-
color: #44b4cc;
|
265
|
-
}
|
266
|
-
.ruby .punct {
|
267
|
-
color: white;
|
268
|
-
}
|
269
|
-
.ruby .escape {
|
270
|
-
color: white;
|
271
|
-
}
|
272
|
-
.ruby .interp {
|
273
|
-
color: white;
|
274
|
-
}
|
275
|
-
.ruby .expr {
|
276
|
-
color: white;
|
277
|
-
}
|
278
|
-
.ruby .offending {
|
279
|
-
background: #333333;
|
280
|
-
}
|
281
|
-
.ruby .linenum {
|
282
|
-
width: 75px;
|
283
|
-
padding: 0.1em 1em 0.2em 0;
|
284
|
-
color: black;
|
285
|
-
background: #fffbd3;
|
286
|
-
}
|
@@ -1,247 +0,0 @@
|
|
1
|
-
/* cucumber.css is generated from cucumber.sass */
|
2
|
-
/* Regenerate with rake sass */
|
3
|
-
|
4
|
-
$step_left: 5px solid
|
5
|
-
$step_bottom: 1px solid
|
6
|
-
|
7
|
-
$failed: #fffbd3
|
8
|
-
$failed_border: #c20000
|
9
|
-
$failed_text: #c20000
|
10
|
-
|
11
|
-
$passed: #dbffb4
|
12
|
-
$passed_border: #65c400
|
13
|
-
$passed_text: #3d7700
|
14
|
-
|
15
|
-
$skipped: #e0ffff
|
16
|
-
$skipped_border: aqua
|
17
|
-
$skipped_text: #001111
|
18
|
-
|
19
|
-
$pending: #fcfb98
|
20
|
-
$pending_border: #faf834
|
21
|
-
$pending_text: #131313
|
22
|
-
|
23
|
-
$undefined: #fcfb98
|
24
|
-
$undefined_border: #faf834
|
25
|
-
$undefined_text: #131313
|
26
|
-
|
27
|
-
$message: #e0ffff
|
28
|
-
$message_border: aqua
|
29
|
-
$message_text: #001111
|
30
|
-
|
31
|
-
body
|
32
|
-
font-size: 0px
|
33
|
-
color: white
|
34
|
-
margin: 0px
|
35
|
-
padding: 0px
|
36
|
-
|
37
|
-
.cucumber,td,th
|
38
|
-
font: normal 11px "Lucida Grande", Helvetica, sans-serif
|
39
|
-
background: white
|
40
|
-
color: black
|
41
|
-
#cucumber-header
|
42
|
-
background: #65c400
|
43
|
-
color: white
|
44
|
-
height: 6em
|
45
|
-
#expand-collapse
|
46
|
-
p
|
47
|
-
float: right
|
48
|
-
margin: 0 0 0 10px
|
49
|
-
.scenario
|
50
|
-
h3
|
51
|
-
font-size: 11px
|
52
|
-
padding: 3px
|
53
|
-
margin: 0
|
54
|
-
background: #65c400
|
55
|
-
color: white
|
56
|
-
font-weight: bold
|
57
|
-
h1
|
58
|
-
margin: 0px 10px 0px 10px
|
59
|
-
padding: 10px
|
60
|
-
font-family: "Lucida Grande", Helvetica, sans-serif
|
61
|
-
font-size: 2em
|
62
|
-
position: absolute
|
63
|
-
h4
|
64
|
-
margin-bottom: 2px
|
65
|
-
div.feature
|
66
|
-
padding: 2px
|
67
|
-
margin: 0px 10px 5px 10px
|
68
|
-
div.examples
|
69
|
-
padding: 0em 0em 0em 1em
|
70
|
-
.stats
|
71
|
-
margin: 2em
|
72
|
-
.summary
|
73
|
-
ul.features
|
74
|
-
li
|
75
|
-
display: inline
|
76
|
-
.step_name
|
77
|
-
float: left
|
78
|
-
.step_file
|
79
|
-
text-align: right
|
80
|
-
color: #999999
|
81
|
-
a
|
82
|
-
color: #999999
|
83
|
-
.scenario_file
|
84
|
-
float: right
|
85
|
-
color: #999999
|
86
|
-
.tag
|
87
|
-
font-weight: bold
|
88
|
-
color: #246ac1
|
89
|
-
.backtrace
|
90
|
-
margin-top: 0
|
91
|
-
margin-bottom: 0
|
92
|
-
margin-left: 1em
|
93
|
-
color: black
|
94
|
-
a
|
95
|
-
text-decoration: none
|
96
|
-
color: #be5c00
|
97
|
-
&:hover
|
98
|
-
text-decoration: underline
|
99
|
-
&:visited
|
100
|
-
font-weight: normal
|
101
|
-
div.examples
|
102
|
-
margin: 5px 0px 5px 15px
|
103
|
-
color: black
|
104
|
-
.outline
|
105
|
-
table
|
106
|
-
margin: 0px 0px 5px 10px
|
107
|
-
table
|
108
|
-
border-collapse: collapse
|
109
|
-
td
|
110
|
-
padding: 3px 3px 3px 5px
|
111
|
-
td.failed, td.passed, td.skipped, td.pending, td.undefined
|
112
|
-
padding-left: 18px
|
113
|
-
padding-right: 10px
|
114
|
-
td.failed
|
115
|
-
border-left: $step_left $failed_border
|
116
|
-
border-bottom: $step_bottom $failed_border
|
117
|
-
background: $failed
|
118
|
-
color: $failed_text
|
119
|
-
td.passed
|
120
|
-
border-left: $step_left $passed_border
|
121
|
-
border-bottom: $step_bottom $passed_border
|
122
|
-
background: $passed
|
123
|
-
color: $passed_text
|
124
|
-
td.skipped
|
125
|
-
border-left: $step_left $skipped_border
|
126
|
-
border-bottom: $step_bottom $skipped_border
|
127
|
-
background: $skipped
|
128
|
-
color: $skipped_text
|
129
|
-
td.pending
|
130
|
-
border-left: $step_left $pending_border
|
131
|
-
border-bottom: $step_bottom $pending_border
|
132
|
-
background: $pending
|
133
|
-
color: $pending_text
|
134
|
-
td.undefined
|
135
|
-
border-left: $step_left $undefined_border
|
136
|
-
border-bottom: $step_bottom $undefined_border
|
137
|
-
background: $undefined
|
138
|
-
color: $undefined_text
|
139
|
-
td.message
|
140
|
-
border-left: $step_left $message_border
|
141
|
-
border-bottom: $step_bottom $message_border
|
142
|
-
background: $message
|
143
|
-
color: $message_text
|
144
|
-
ol
|
145
|
-
list-style: none
|
146
|
-
margin: 0px
|
147
|
-
padding: 0px
|
148
|
-
li.step
|
149
|
-
padding: 3px 3px 3px 18px
|
150
|
-
margin: 5px 0px 5px 5px
|
151
|
-
li
|
152
|
-
margin: 0em 0em 0em 1em
|
153
|
-
padding: 0em 0em 0em 0.2em
|
154
|
-
span.param
|
155
|
-
font-weight: bold
|
156
|
-
li.failed
|
157
|
-
border-left: $step_left $failed_border
|
158
|
-
border-bottom: $step_bottom $failed_border
|
159
|
-
background: $failed
|
160
|
-
color: $failed_text
|
161
|
-
li.passed
|
162
|
-
border-left: $step_left $passed_border
|
163
|
-
border-bottom: $step_bottom $passed_border
|
164
|
-
background: $passed
|
165
|
-
color: $passed_text
|
166
|
-
li.skipped
|
167
|
-
border-left: $step_left $skipped_border
|
168
|
-
border-bottom: $step_bottom $skipped_border
|
169
|
-
background: $skipped
|
170
|
-
color: $skipped_text
|
171
|
-
li.pending
|
172
|
-
border-left: $step_left $pending_border
|
173
|
-
border-bottom: $step_bottom $pending_border
|
174
|
-
background: $pending
|
175
|
-
color: $pending_text
|
176
|
-
li.undefined
|
177
|
-
border-left: $step_left $undefined_border
|
178
|
-
border-bottom: $step_bottom $undefined_border
|
179
|
-
background: $undefined
|
180
|
-
color: $undefined_text
|
181
|
-
li.message
|
182
|
-
border-left: $step_left $message_border
|
183
|
-
border-bottom: $step_bottom $message_border
|
184
|
-
background: $message
|
185
|
-
color: $message_text
|
186
|
-
margin-left: 10px
|
187
|
-
#summary
|
188
|
-
margin: 0px
|
189
|
-
padding: 5px 10px
|
190
|
-
text-align: right
|
191
|
-
top: 0px
|
192
|
-
right: 0px
|
193
|
-
float: right
|
194
|
-
p
|
195
|
-
margin: 0 0 0 2px
|
196
|
-
#totals
|
197
|
-
font-size: 1.2em
|
198
|
-
|
199
|
-
.ruby
|
200
|
-
font-size: 12px
|
201
|
-
font-family: monospace
|
202
|
-
color: white
|
203
|
-
background: black
|
204
|
-
padding: 0.1em 0 0.2em 0
|
205
|
-
.keyword
|
206
|
-
color: #ff6600
|
207
|
-
.constant
|
208
|
-
color: #339999
|
209
|
-
.attribute
|
210
|
-
color: white
|
211
|
-
.global
|
212
|
-
color: white
|
213
|
-
.module
|
214
|
-
color: white
|
215
|
-
.class
|
216
|
-
color: white
|
217
|
-
.string
|
218
|
-
color: #66ff00
|
219
|
-
.ident
|
220
|
-
color: white
|
221
|
-
.method
|
222
|
-
color: #ffcc00
|
223
|
-
.number
|
224
|
-
color: white
|
225
|
-
.char
|
226
|
-
color: white
|
227
|
-
.comment
|
228
|
-
color: #9933cc
|
229
|
-
.symbol
|
230
|
-
color: white
|
231
|
-
.regex
|
232
|
-
color: #44b4cc
|
233
|
-
.punct
|
234
|
-
color: white
|
235
|
-
.escape
|
236
|
-
color: white
|
237
|
-
.interp
|
238
|
-
color: white
|
239
|
-
.expr
|
240
|
-
color: white
|
241
|
-
.offending
|
242
|
-
background: #333333
|
243
|
-
.linenum
|
244
|
-
width: 75px
|
245
|
-
padding: 0.1em 1em 0.2em 0
|
246
|
-
color: black
|
247
|
-
background: #fffbd3
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Cucumber
|
4
|
-
module Formatter
|
5
|
-
class HookQueryVisitor
|
6
|
-
attr_reader :type
|
7
|
-
|
8
|
-
def initialize(test_step)
|
9
|
-
@hook = false
|
10
|
-
@type = :no_hook
|
11
|
-
test_step.source.last.describe_to(self)
|
12
|
-
end
|
13
|
-
|
14
|
-
def hook?
|
15
|
-
@hook
|
16
|
-
end
|
17
|
-
|
18
|
-
def step(*)
|
19
|
-
end
|
20
|
-
|
21
|
-
def before_hook(*)
|
22
|
-
@hook = true
|
23
|
-
@type = :before
|
24
|
-
end
|
25
|
-
|
26
|
-
def after_hook(*)
|
27
|
-
@hook = true
|
28
|
-
@type = :after
|
29
|
-
end
|
30
|
-
|
31
|
-
def after_step_hook(*)
|
32
|
-
@hook = true
|
33
|
-
@type = :after_step
|
34
|
-
end
|
35
|
-
|
36
|
-
def around_hook(*)
|
37
|
-
@hook = true
|
38
|
-
@type = :around
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,121 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'builder'
|
4
|
-
require 'pathname'
|
5
|
-
|
6
|
-
module Cucumber
|
7
|
-
module Formatter
|
8
|
-
class HtmlBuilder < Builder::XmlMarkup
|
9
|
-
VALID_EMBED_TYPES = [:text, :image].freeze
|
10
|
-
|
11
|
-
class InvalidEmbedTypeError < ::StandardError
|
12
|
-
MESSAGE = 'Invalid embed type. Valid types are :text and :image.'.freeze
|
13
|
-
|
14
|
-
def initialize(message = MESSAGE)
|
15
|
-
super(message)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def embed(type: nil, src: nil, label: nil, id: nil)
|
20
|
-
prepend_to_span('embed', string_to_embed(type: type, src: src, label: label, id: id))
|
21
|
-
end
|
22
|
-
|
23
|
-
def declare!
|
24
|
-
super(:DOCTYPE, :html, :PUBLIC, '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd')
|
25
|
-
end
|
26
|
-
|
27
|
-
def build_document!
|
28
|
-
declare! # <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
29
|
-
|
30
|
-
self << '<html xmlns ="http://www.w3.org/1999/xhtml">'
|
31
|
-
|
32
|
-
set_head_tags
|
33
|
-
end
|
34
|
-
|
35
|
-
def format_features!(features)
|
36
|
-
step_count = features && features.step_count || 0
|
37
|
-
|
38
|
-
self << '<body>'
|
39
|
-
self << "<!-- Step count #{step_count}-->"
|
40
|
-
self << '<div class="cucumber">'
|
41
|
-
|
42
|
-
div(id: 'cucumber-header') do
|
43
|
-
div(id: 'label') do
|
44
|
-
h1 'Cucumber Features'
|
45
|
-
end
|
46
|
-
|
47
|
-
summary_div
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
def string_to_embed(type: nil, src: nil, label: nil, id: nil)
|
54
|
-
raise ::ArgumentError, 'missing required argument' unless type && src && label && id # for Ruby 2.0 compatibility
|
55
|
-
raise InvalidEmbedTypeError unless VALID_EMBED_TYPES.include?(type)
|
56
|
-
|
57
|
-
if type == :image
|
58
|
-
%{<a href="" onclick="img=document.getElementById('#{id}'); img.style.display = (img.style.display == 'none' ? 'block' : 'none');return false">#{label}</a><br>
|
59
|
-
<img id="#{id}" style="display: none" src="#{src}"/>}
|
60
|
-
else
|
61
|
-
%{<a id="#{id}" href="#{src}" title="#{label}">#{label}</a>}
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def summary_div
|
66
|
-
div(id: 'summary') do
|
67
|
-
p('', id: 'totals')
|
68
|
-
p('', id: 'duration')
|
69
|
-
|
70
|
-
expand_collapse
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def expand_collapse
|
75
|
-
div(id: 'expand-collapse') do
|
76
|
-
p('Expand All', id: 'expander')
|
77
|
-
p('Collapse All', id: 'collapser')
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
def prepend_to_span(span_class, content)
|
82
|
-
span(class: span_class) do |pre|
|
83
|
-
pre << content
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def inline_css
|
88
|
-
style(type: 'text/css') do
|
89
|
-
pn = ::Pathname.new(::File.dirname(__FILE__) + '/cucumber.css')
|
90
|
-
self << pn.read
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def inline_js
|
95
|
-
script(type: 'text/javascript') do
|
96
|
-
self << inline_jquery
|
97
|
-
self << inline_js_content
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
def inline_jquery
|
102
|
-
pn = ::Pathname.new(::File.dirname(__FILE__) + '/jquery-min.js')
|
103
|
-
pn.read
|
104
|
-
end
|
105
|
-
|
106
|
-
def inline_js_content # rubocop:disable
|
107
|
-
pn = ::Pathname.new(::File.dirname(__FILE__) + '/inline-js.js')
|
108
|
-
pn.read
|
109
|
-
end
|
110
|
-
|
111
|
-
def set_head_tags
|
112
|
-
head do
|
113
|
-
meta('http-equiv' => 'Content-Type', :content => 'text/html;charset=utf-8')
|
114
|
-
title 'Cucumber'
|
115
|
-
inline_css
|
116
|
-
inline_js
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
SCENARIOS = "h3[id^='scenario_'],h3[id^=background_]";
|
2
|
-
|
3
|
-
$(document).ready(function() {
|
4
|
-
$(SCENARIOS).css('cursor', 'pointer');
|
5
|
-
$(SCENARIOS).click(function() {
|
6
|
-
$(this).siblings().toggle(250);
|
7
|
-
});
|
8
|
-
|
9
|
-
$("#collapser").css('cursor', 'pointer');
|
10
|
-
$("#collapser").click(function() {
|
11
|
-
$(SCENARIOS).siblings().hide();
|
12
|
-
});
|
13
|
-
|
14
|
-
$("#expander").css('cursor', 'pointer');
|
15
|
-
$("#expander").click(function() {
|
16
|
-
$(SCENARIOS).siblings().show();
|
17
|
-
});
|
18
|
-
})
|
19
|
-
|
20
|
-
function moveProgressBar(percentDone) {
|
21
|
-
$("cucumber-header").css('width', percentDone +"%");
|
22
|
-
}
|
23
|
-
function makeRed(element_id) {
|
24
|
-
$('#'+element_id).css('background', '#C40D0D');
|
25
|
-
$('#'+element_id).css('color', '#FFFFFF');
|
26
|
-
}
|
27
|
-
function makeYellow(element_id) {
|
28
|
-
$('#'+element_id).css('background', '#FAF834');
|
29
|
-
$('#'+element_id).css('color', '#000000');
|
30
|
-
}
|