cucumber 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -1
- data/Caliper.yml +4 -0
- data/History.txt +1557 -0
- data/LICENSE +1 -1
- data/README.rdoc +26 -0
- data/Rakefile +51 -5
- data/VERSION.yml +5 -0
- data/bin/cucumber +1 -7
- data/cucumber.gemspec +77 -3
- data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/he/features/step_definitons/calculator_steps.rb +1 -1
- data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +7 -4
- data/examples/i18n/ro/features/suma.feature +11 -0
- data/examples/i18n/ru/features/division.feature +2 -2
- data/examples/i18n/tr/features/step_definitons/hesap_makinesi_adimlari.rb +3 -3
- data/examples/sinatra/features/support/env.rb +5 -2
- data/examples/v8/features/fibonacci.feature +1 -1
- data/examples/watir/features/step_definitions/search_steps.rb +1 -1
- data/features/announce.feature +164 -0
- data/features/around_hooks.feature +232 -0
- data/features/background.feature +95 -284
- data/features/bug_371.feature +32 -0
- data/features/bug_464.feature +16 -0
- data/features/bug_475.feature +42 -0
- data/features/bug_585_tab_indentation.feature +22 -0
- data/features/bug_600.feature +67 -0
- data/features/call_steps_from_stepdefs.feature +154 -0
- data/features/cucumber_cli.feature +591 -0
- data/features/cucumber_cli_outlines.feature +117 -0
- data/features/custom_formatter.feature +73 -3
- data/features/default_snippets.feature +42 -0
- data/features/diffing.feature +25 -0
- data/features/drb_server_integration.feature +174 -0
- data/features/exception_in_after_block.feature +127 -0
- data/features/exception_in_after_step_block.feature +104 -0
- data/features/exception_in_before_block.feature +98 -0
- data/features/exclude_files.feature +20 -0
- data/features/expand.feature +60 -0
- data/features/html_formatter.feature +8 -0
- data/features/html_formatter/a.html +582 -0
- data/features/json_formatter.feature +245 -160
- data/features/junit_formatter.feature +88 -0
- data/features/language_from_header.feature +30 -0
- data/features/language_help.feature +78 -0
- data/features/listener_debugger_formatter.feature +42 -0
- data/features/multiline_names.feature +44 -0
- data/features/negative_tagged_hooks.feature +60 -0
- data/features/post_configuration_hook.feature +37 -0
- data/features/profiles.feature +126 -0
- data/features/rake_task.feature +152 -0
- data/features/report_called_undefined_steps.feature +34 -0
- data/features/rerun_formatter.feature +45 -0
- data/features/simplest.feature +11 -0
- data/features/snippet.feature +23 -0
- data/features/snippets_when_using_star_keyword.feature +36 -0
- data/features/step_definitions/cucumber_steps.rb +153 -7
- data/features/step_definitions/extra_steps.rb +2 -0
- data/features/step_definitions/simplest_steps.rb +3 -0
- data/features/step_definitions/wire_steps.rb +32 -0
- data/features/support/env.rb +140 -18
- data/features/support/env.rb.simplest +7 -0
- data/features/support/fake_wire_server.rb +77 -0
- data/features/table_diffing.feature +45 -0
- data/features/table_mapping.feature +34 -0
- data/features/tag_logic.feature +258 -0
- data/features/transform.feature +245 -0
- data/features/unicode_table.feature +35 -0
- data/features/usage_and_stepdefs_formatter.feature +169 -0
- data/features/wire_protocol.feature +332 -0
- data/features/wire_protocol_table_diffing.feature +119 -0
- data/features/wire_protocol_tags.feature +87 -0
- data/features/wire_protocol_timeouts.feature +63 -0
- data/features/work_in_progress.feature +156 -0
- data/fixtures/json/features/pystring.feature +8 -0
- data/fixtures/junit/features/pending.feature +1 -3
- data/fixtures/self_test/features/background/background_tagged_before_on_outline.feature +12 -0
- data/fixtures/self_test/features/background/background_with_name.feature +7 -0
- data/fixtures/self_test/features/background/failing_background.feature +12 -0
- data/fixtures/self_test/features/background/failing_background_after_success.feature +11 -0
- data/fixtures/self_test/features/background/multiline_args_background.feature +32 -0
- data/fixtures/self_test/features/background/passing_background.feature +10 -0
- data/fixtures/self_test/features/background/pending_background.feature +10 -0
- data/fixtures/self_test/features/background/scenario_outline_failing_background.feature +16 -0
- data/fixtures/self_test/features/background/scenario_outline_passing_background.feature +16 -0
- data/fixtures/self_test/features/support/env.rb +0 -8
- data/fixtures/tickets/features.html +1 -1
- data/gem_tasks/examples.rake +1 -1
- data/gem_tasks/features.rake +14 -0
- data/gem_tasks/sdoc.rake +12 -0
- data/lib/cucumber.rb +0 -12
- data/lib/cucumber/ast.rb +1 -1
- data/lib/cucumber/ast/background.rb +5 -21
- data/lib/cucumber/ast/examples.rb +4 -12
- data/lib/cucumber/ast/feature.rb +5 -13
- data/lib/cucumber/ast/feature_element.rb +4 -9
- data/lib/cucumber/ast/outline_table.rb +4 -4
- data/lib/cucumber/ast/py_string.rb +80 -0
- data/lib/cucumber/ast/scenario.rb +5 -7
- data/lib/cucumber/ast/scenario_outline.rb +15 -23
- data/lib/cucumber/ast/step.rb +0 -5
- data/lib/cucumber/ast/step_invocation.rb +15 -21
- data/lib/cucumber/ast/table.rb +8 -14
- data/lib/cucumber/ast/tree_walker.rb +48 -10
- data/lib/cucumber/cli/configuration.rb +8 -33
- data/lib/cucumber/cli/main.rb +35 -20
- data/lib/cucumber/cli/options.rb +7 -8
- data/lib/cucumber/cli/profile_loader.rb +0 -2
- data/lib/cucumber/core_ext/proc.rb +1 -2
- data/lib/cucumber/feature_file.rb +15 -47
- data/lib/cucumber/formatter/ansicolor.rb +5 -3
- data/lib/cucumber/formatter/color_io.rb +23 -0
- data/lib/cucumber/formatter/console.rb +23 -27
- data/lib/cucumber/formatter/cucumber.css +17 -34
- data/lib/cucumber/formatter/cucumber.sass +182 -173
- data/lib/cucumber/formatter/html.rb +11 -46
- data/lib/cucumber/formatter/io.rb +4 -2
- data/lib/cucumber/formatter/json.rb +152 -15
- data/lib/cucumber/formatter/json_pretty.rb +6 -5
- data/lib/cucumber/formatter/junit.rb +22 -28
- data/lib/cucumber/formatter/pdf.rb +6 -6
- data/lib/cucumber/formatter/pretty.rb +5 -5
- data/lib/cucumber/formatter/rerun.rb +11 -22
- data/lib/cucumber/formatter/tag_cloud.rb +35 -0
- data/lib/cucumber/formatter/unicode.rb +20 -41
- data/lib/cucumber/js_support/js_dsl.js +4 -4
- data/lib/cucumber/js_support/js_language.rb +5 -9
- data/lib/cucumber/js_support/js_snippets.rb +2 -2
- data/lib/cucumber/language_support.rb +2 -2
- data/lib/cucumber/parser/gherkin_builder.rb +30 -35
- data/lib/cucumber/platform.rb +8 -8
- data/lib/cucumber/py_support/py_language.rb +2 -2
- data/lib/cucumber/rake/task.rb +31 -74
- data/lib/cucumber/rb_support/rb_dsl.rb +0 -1
- data/lib/cucumber/rb_support/rb_language.rb +8 -10
- data/lib/cucumber/rb_support/rb_step_definition.rb +0 -8
- data/lib/cucumber/rb_support/rb_transform.rb +0 -17
- data/lib/cucumber/rb_support/rb_world.rb +18 -26
- data/lib/cucumber/rspec/doubles.rb +3 -3
- data/lib/cucumber/step_match.rb +2 -6
- data/lib/cucumber/step_mother.rb +427 -6
- data/lib/cucumber/wire_support/configuration.rb +1 -4
- data/lib/cucumber/wire_support/wire_language.rb +10 -3
- data/spec/cucumber/ast/background_spec.rb +6 -68
- data/spec/cucumber/ast/feature_factory.rb +4 -5
- data/spec/cucumber/ast/feature_spec.rb +4 -4
- data/spec/cucumber/ast/outline_table_spec.rb +1 -1
- data/spec/cucumber/ast/py_string_spec.rb +40 -0
- data/spec/cucumber/ast/scenario_outline_spec.rb +11 -15
- data/spec/cucumber/ast/scenario_spec.rb +4 -4
- data/spec/cucumber/ast/step_spec.rb +3 -3
- data/spec/cucumber/ast/table_spec.rb +2 -38
- data/spec/cucumber/ast/tree_walker_spec.rb +2 -2
- data/spec/cucumber/broadcaster_spec.rb +1 -1
- data/spec/cucumber/cli/configuration_spec.rb +6 -32
- data/spec/cucumber/cli/drb_client_spec.rb +3 -2
- data/spec/cucumber/cli/main_spec.rb +43 -43
- data/spec/cucumber/cli/options_spec.rb +1 -28
- data/spec/cucumber/cli/profile_loader_spec.rb +1 -1
- data/spec/cucumber/core_ext/proc_spec.rb +1 -1
- data/spec/cucumber/formatter/ansicolor_spec.rb +1 -1
- data/spec/cucumber/formatter/color_io_spec.rb +29 -0
- data/spec/cucumber/formatter/duration_spec.rb +1 -1
- data/spec/cucumber/formatter/html_spec.rb +5 -3
- data/spec/cucumber/formatter/junit_spec.rb +2 -16
- data/spec/cucumber/formatter/progress_spec.rb +1 -1
- data/spec/cucumber/formatter/spec_helper.rb +12 -11
- data/spec/cucumber/rb_support/rb_language_spec.rb +28 -241
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +28 -33
- data/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb +1 -1
- data/spec/cucumber/step_match_spec.rb +9 -11
- data/spec/cucumber/step_mother_spec.rb +302 -0
- data/spec/cucumber/wire_support/configuration_spec.rb +1 -1
- data/spec/cucumber/wire_support/connection_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_exception_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_language_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_packet_spec.rb +1 -1
- data/spec/cucumber/wire_support/wire_step_definition_spec.rb +1 -1
- data/spec/cucumber/world/pending_spec.rb +2 -2
- data/spec/spec_helper.rb +20 -13
- metadata +78 -4
@@ -1,137 +1,71 @@
|
|
1
1
|
Feature: JSON output formatter
|
2
|
-
In order to
|
3
|
-
|
2
|
+
In order to get results as data
|
3
|
+
As a developer
|
4
|
+
Cucumber should be able to output JSON
|
4
5
|
|
5
6
|
Background:
|
6
|
-
Given
|
7
|
-
"""
|
8
|
-
@a
|
9
|
-
Feature: One passing scenario, one failing scenario
|
10
|
-
|
11
|
-
@b
|
12
|
-
Scenario: Passing
|
13
|
-
Given a passing step
|
14
|
-
|
15
|
-
@c
|
16
|
-
Scenario: Failing
|
17
|
-
Given a failing step
|
18
|
-
"""
|
19
|
-
And a file named "features/step_definitions/steps.rb" with:
|
20
|
-
"""
|
21
|
-
Given /a passing step/ do
|
22
|
-
#does nothing
|
23
|
-
end
|
24
|
-
|
25
|
-
Given /a failing step/ do
|
26
|
-
fail
|
27
|
-
end
|
28
|
-
|
29
|
-
Given /a pending step/ do
|
30
|
-
pending
|
31
|
-
end
|
32
|
-
|
33
|
-
Given /^I add (\d+) and (\d+)$/ do |a,b|
|
34
|
-
@result = a.to_i + b.to_i
|
35
|
-
end
|
7
|
+
Given I am in json
|
36
8
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
Given /^I pass a table argument/ do |table|
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
Given /^I embed a screenshot/ do
|
50
|
-
File.open("screenshot.png", "w") { |file| file << "foo" }
|
51
|
-
embed "screenshot.png", "image/png"
|
52
|
-
end
|
9
|
+
Scenario: one feature, one passing scenario, one failing scenario
|
10
|
+
And the tmp directory is empty
|
11
|
+
When I run cucumber --format json --out tmp/out.json features/one_passing_one_failing.feature
|
12
|
+
Then STDERR should be empty
|
13
|
+
And it should fail with
|
53
14
|
"""
|
54
|
-
And a file named "features/embed.feature" with:
|
55
15
|
"""
|
56
|
-
|
57
|
-
|
58
|
-
Scenario:
|
59
|
-
Given I embed a screenshot
|
60
|
-
|
61
|
-
"""
|
62
|
-
|
63
|
-
Scenario: one feature, one passing scenario, one failing scenario
|
64
|
-
When I run cucumber "--format json features/one_passing_one_failing.feature"
|
65
|
-
Then the output should match /^\{"features":\[/
|
16
|
+
And "fixtures/json/tmp/out.json" should match "^\{\"features\":\["
|
66
17
|
|
67
18
|
Scenario: one feature, one passing scenario, one failing scenario
|
68
|
-
When I run cucumber
|
69
|
-
Then
|
19
|
+
When I run cucumber --format json_pretty features/one_passing_one_failing.feature
|
20
|
+
Then STDERR should be empty
|
21
|
+
And it should fail with JSON
|
70
22
|
"""
|
71
23
|
{
|
72
24
|
"features": [
|
73
25
|
{
|
74
|
-
"
|
26
|
+
"file": "features/one_passing_one_failing.feature",
|
75
27
|
"name": "One passing scenario, one failing scenario",
|
76
|
-
"line": 2,
|
77
|
-
"description": "",
|
78
28
|
"tags": [
|
79
|
-
|
80
|
-
"name": "@a",
|
81
|
-
"line": 1
|
82
|
-
}
|
29
|
+
"@a"
|
83
30
|
],
|
84
31
|
"elements": [
|
85
32
|
{
|
86
|
-
"keyword": "Scenario",
|
87
|
-
"name": "Passing",
|
88
|
-
"line": 5,
|
89
|
-
"description": "",
|
90
33
|
"tags": [
|
91
|
-
|
92
|
-
"name": "@b",
|
93
|
-
"line": 4
|
94
|
-
}
|
34
|
+
"@b"
|
95
35
|
],
|
96
|
-
"
|
36
|
+
"keyword": "Scenario",
|
37
|
+
"name": "Passing",
|
38
|
+
"file_colon_line": "features/one_passing_one_failing.feature:5",
|
97
39
|
"steps": [
|
98
40
|
{
|
41
|
+
"status": "passed",
|
99
42
|
"keyword": "Given ",
|
100
43
|
"name": "a passing step",
|
101
|
-
"
|
102
|
-
"match": {
|
103
|
-
"location": "features/step_definitions/steps.rb:1"
|
104
|
-
},
|
105
|
-
"result": {
|
106
|
-
"status": "passed"
|
107
|
-
}
|
44
|
+
"file_colon_line": "features/step_definitions/steps.rb:1"
|
108
45
|
}
|
109
46
|
]
|
110
47
|
},
|
111
48
|
{
|
112
|
-
"keyword": "Scenario",
|
113
|
-
"name": "Failing",
|
114
|
-
"line": 9,
|
115
|
-
"description": "",
|
116
49
|
"tags": [
|
117
|
-
|
118
|
-
"name": "@c",
|
119
|
-
"line": 8
|
120
|
-
}
|
50
|
+
"@c"
|
121
51
|
],
|
122
|
-
"
|
52
|
+
"keyword": "Scenario",
|
53
|
+
"name": "Failing",
|
54
|
+
"file_colon_line": "features/one_passing_one_failing.feature:9",
|
123
55
|
"steps": [
|
124
56
|
{
|
57
|
+
"exception": {
|
58
|
+
"class": "RuntimeError",
|
59
|
+
"message": "",
|
60
|
+
"backtrace": [
|
61
|
+
"./features/step_definitions/steps.rb:6:in `/a failing step/'",
|
62
|
+
"features/one_passing_one_failing.feature:10:in `Given a failing step'"
|
63
|
+
]
|
64
|
+
},
|
65
|
+
"status": "failed",
|
125
66
|
"keyword": "Given ",
|
126
67
|
"name": "a failing step",
|
127
|
-
"
|
128
|
-
"match": {
|
129
|
-
"location": "features/step_definitions/steps.rb:5"
|
130
|
-
},
|
131
|
-
"result": {
|
132
|
-
"status": "failed",
|
133
|
-
"error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:6:in `/a failing step/'\nfeatures/one_passing_one_failing.feature:10:in `Given a failing step'"
|
134
|
-
}
|
68
|
+
"file_colon_line": "features/step_definitions/steps.rb:5"
|
135
69
|
}
|
136
70
|
]
|
137
71
|
}
|
@@ -139,60 +73,153 @@ Feature: JSON output formatter
|
|
139
73
|
}
|
140
74
|
]
|
141
75
|
}
|
142
|
-
|
143
76
|
"""
|
144
77
|
|
145
|
-
Scenario:
|
146
|
-
|
78
|
+
Scenario: Tables
|
79
|
+
When I run cucumber --format json_pretty features/tables.feature
|
80
|
+
Then STDERR should be empty
|
81
|
+
And it should fail with JSON
|
147
82
|
"""
|
148
|
-
|
83
|
+
{
|
84
|
+
"features": [
|
85
|
+
{
|
86
|
+
"file": "features/tables.feature",
|
87
|
+
"name": "A scenario outline",
|
88
|
+
"tags": [
|
149
89
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
90
|
+
],
|
91
|
+
"elements": [
|
92
|
+
{
|
93
|
+
"tags": [
|
94
|
+
|
95
|
+
],
|
96
|
+
"keyword": "Scenario Outline",
|
97
|
+
"name": "",
|
98
|
+
"file_colon_line": "features/tables.feature:3",
|
99
|
+
"steps": [
|
100
|
+
{
|
101
|
+
"status": "skipped",
|
102
|
+
"keyword": "Given ",
|
103
|
+
"name": "I add <a> and <b>",
|
104
|
+
"file_colon_line": "features/step_definitions/steps.rb:13"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"status": "skipped",
|
108
|
+
"keyword": "When ",
|
109
|
+
"name": "I pass a table argument",
|
110
|
+
"file_colon_line": "features/step_definitions/steps.rb:25",
|
111
|
+
"table": [
|
112
|
+
{"cells":
|
113
|
+
[{"text":"foo", "status": null},
|
114
|
+
{"text":"bar", "status": null}]},
|
115
|
+
{"cells":
|
116
|
+
[{"text": "bar", "status": null},
|
117
|
+
{"text": "baz", "status": null}]}
|
118
|
+
]
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"status": "skipped",
|
122
|
+
"keyword": "Then ",
|
123
|
+
"name": "I the result should be <c>",
|
124
|
+
"file_colon_line": "features/step_definitions/steps.rb:17"
|
125
|
+
}
|
126
|
+
],
|
127
|
+
"examples": {
|
128
|
+
"name": "Examples ",
|
129
|
+
"table": [
|
130
|
+
{
|
131
|
+
"cells": [
|
132
|
+
{
|
133
|
+
"text": "a",
|
134
|
+
"status": "skipped_param"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"text": "b",
|
138
|
+
"status": "skipped_param"
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"text": "c",
|
142
|
+
"status": "skipped_param"
|
143
|
+
}
|
144
|
+
]
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"cells": [
|
148
|
+
{
|
149
|
+
"text": "1",
|
150
|
+
"status": "passed"
|
151
|
+
},
|
152
|
+
{
|
153
|
+
"text": "2",
|
154
|
+
"status": "passed"
|
155
|
+
},
|
156
|
+
{
|
157
|
+
"text": "3",
|
158
|
+
"status": "passed"
|
159
|
+
}
|
160
|
+
]
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"cells": [
|
164
|
+
{
|
165
|
+
"text": "2",
|
166
|
+
"status": "passed"
|
167
|
+
},
|
168
|
+
{
|
169
|
+
"text": "3",
|
170
|
+
"status": "passed"
|
171
|
+
},
|
172
|
+
{
|
173
|
+
"text": "4",
|
174
|
+
"status": "failed"
|
175
|
+
}
|
176
|
+
],
|
177
|
+
"exception": {
|
178
|
+
"class": "RSpec::Expectations::ExpectationNotMetError",
|
179
|
+
"message": "expected: 4,\n got: 5 (using ==)\nDiff:\n@@ -1,2 +1,2 @@\n-4\n+5\n",
|
180
|
+
"backtrace": [
|
181
|
+
"./features/step_definitions/steps.rb:18:in `/^I the result should be (\\d+)$/'",
|
182
|
+
"features/tables.feature:8:in `Then I the result should be <c>'"
|
183
|
+
]
|
184
|
+
}
|
185
|
+
}
|
186
|
+
]
|
187
|
+
}
|
188
|
+
}
|
189
|
+
]
|
190
|
+
}
|
191
|
+
]
|
192
|
+
}
|
164
193
|
"""
|
194
|
+
|
195
|
+
Scenario: pystring
|
196
|
+
When I run cucumber --format json_pretty features/pystring.feature
|
197
|
+
Then STDERR should be empty
|
198
|
+
And it should pass with JSON
|
199
|
+
"""
|
165
200
|
{
|
166
201
|
"features": [
|
167
202
|
{
|
168
|
-
"
|
169
|
-
"name": "A
|
170
|
-
"
|
171
|
-
|
203
|
+
"file": "features/pystring.feature",
|
204
|
+
"name": "A py string feature",
|
205
|
+
"tags": [
|
206
|
+
|
207
|
+
],
|
172
208
|
"elements": [
|
173
209
|
{
|
210
|
+
"tags": [
|
211
|
+
|
212
|
+
],
|
174
213
|
"keyword": "Scenario",
|
175
214
|
"name": "",
|
176
|
-
"
|
177
|
-
"description": "",
|
178
|
-
"type": "scenario",
|
215
|
+
"file_colon_line": "features/pystring.feature:3",
|
179
216
|
"steps": [
|
180
217
|
{
|
218
|
+
"status": "passed",
|
181
219
|
"keyword": "Then ",
|
182
|
-
"name": "I should
|
183
|
-
"
|
184
|
-
"
|
185
|
-
"value": "a string",
|
186
|
-
"line": 5,
|
187
|
-
"type": "doc_string"
|
188
|
-
},
|
189
|
-
"match": {
|
190
|
-
"location": "features/step_definitions/pystring_steps.rb:1"
|
191
|
-
},
|
192
|
-
"result": {
|
193
|
-
"status": "failed",
|
194
|
-
"error_message": "a string (RuntimeError)\n./features/step_definitions/pystring_steps.rb:2:in `/I should fail with/'\nfeatures/pystring.feature:4:in `Then I should fail with'"
|
195
|
-
}
|
220
|
+
"name": "I should see",
|
221
|
+
"file_colon_line": "features/step_definitions/steps.rb:21",
|
222
|
+
"py_string": "a string"
|
196
223
|
}
|
197
224
|
]
|
198
225
|
}
|
@@ -200,43 +227,102 @@ Feature: JSON output formatter
|
|
200
227
|
}
|
201
228
|
]
|
202
229
|
}
|
203
|
-
|
230
|
+
"""
|
231
|
+
|
232
|
+
Scenario: background
|
233
|
+
When I run cucumber --format json_pretty features/background.feature
|
234
|
+
Then STDERR should be empty
|
235
|
+
And it should fail with JSON
|
236
|
+
"""
|
237
|
+
{
|
238
|
+
"features": [
|
239
|
+
{
|
240
|
+
"file": "features/background.feature",
|
241
|
+
"name": "Feature with background",
|
242
|
+
"tags": [
|
243
|
+
|
244
|
+
],
|
245
|
+
"background": {
|
246
|
+
"steps": [
|
247
|
+
{
|
248
|
+
"status": "passed",
|
249
|
+
"keyword": "Given ",
|
250
|
+
"name": "a passing step",
|
251
|
+
"file_colon_line": "features/step_definitions/steps.rb:1"
|
252
|
+
}
|
253
|
+
]
|
254
|
+
},
|
255
|
+
"elements": [
|
256
|
+
{
|
257
|
+
"tags": [
|
258
|
+
|
259
|
+
],
|
260
|
+
"keyword": "Scenario",
|
261
|
+
"name": "",
|
262
|
+
"file_colon_line": "features/background.feature:6",
|
263
|
+
"steps": [
|
264
|
+
{
|
265
|
+
"status": "passed",
|
266
|
+
"keyword": "Given ",
|
267
|
+
"name": "a passing step",
|
268
|
+
"file_colon_line": "features/step_definitions/steps.rb:1"
|
269
|
+
},
|
270
|
+
{
|
271
|
+
"exception": {
|
272
|
+
"class": "RuntimeError",
|
273
|
+
"message": "",
|
274
|
+
"backtrace": [
|
275
|
+
"./features/step_definitions/steps.rb:6:in `/a failing step/'",
|
276
|
+
"features/background.feature:7:in `Given a failing step'"
|
277
|
+
]
|
278
|
+
},
|
279
|
+
"status": "failed",
|
280
|
+
"keyword": "Given ",
|
281
|
+
"name": "a failing step",
|
282
|
+
"file_colon_line": "features/step_definitions/steps.rb:5"
|
283
|
+
}
|
284
|
+
]
|
285
|
+
}
|
286
|
+
]
|
287
|
+
}
|
288
|
+
]
|
289
|
+
}
|
290
|
+
"""
|
204
291
|
|
205
292
|
Scenario: embedding screenshot
|
206
|
-
When I run cucumber
|
207
|
-
Then
|
293
|
+
When I run cucumber --format json_pretty features/embed.feature
|
294
|
+
Then STDERR should be empty
|
295
|
+
And it should pass with JSON
|
208
296
|
"""
|
209
297
|
{
|
210
298
|
"features": [
|
211
299
|
{
|
212
|
-
"
|
300
|
+
"file": "features/embed.feature",
|
213
301
|
"name": "A screenshot feature",
|
214
|
-
"
|
215
|
-
|
302
|
+
"tags": [
|
303
|
+
|
304
|
+
],
|
216
305
|
"elements": [
|
217
306
|
{
|
307
|
+
"tags": [
|
308
|
+
|
309
|
+
],
|
218
310
|
"keyword": "Scenario",
|
219
311
|
"name": "",
|
220
|
-
"
|
221
|
-
"description": "",
|
222
|
-
"type": "scenario",
|
312
|
+
"file_colon_line": "features/embed.feature:3",
|
223
313
|
"steps": [
|
224
314
|
{
|
315
|
+
"status": "passed",
|
225
316
|
"keyword": "Given ",
|
226
317
|
"name": "I embed a screenshot",
|
227
|
-
"
|
228
|
-
"
|
318
|
+
"file_colon_line": "features/step_definitions/steps.rb:29",
|
319
|
+
"embedded": [
|
229
320
|
{
|
321
|
+
"file": "tmp/screenshot.png",
|
230
322
|
"mime_type": "image/png",
|
231
|
-
"data": "Zm9v"
|
323
|
+
"data": "Zm9v\n"
|
232
324
|
}
|
233
|
-
]
|
234
|
-
"match": {
|
235
|
-
"location": "features/step_definitions/steps.rb:29"
|
236
|
-
},
|
237
|
-
"result": {
|
238
|
-
"status": "passed"
|
239
|
-
}
|
325
|
+
]
|
240
326
|
}
|
241
327
|
]
|
242
328
|
}
|
@@ -244,5 +330,4 @@ Feature: JSON output formatter
|
|
244
330
|
}
|
245
331
|
]
|
246
332
|
}
|
247
|
-
|
248
333
|
"""
|