json-formatter
json-formatter copied to clipboard
Inaccurate output of scenario outlined with parameterized name
👓 What did you see?
There's a difference in outputted JSON from cucumber-js compared to its messages piped through cucumber-json-formatter when the scenario outline contains a parameter.
✅ What did you expect to see?
The JSON output of cucumber-js in case of such scenario.
[
{
"description": "",
"elements": [
{
"description": "",
"id": "a-feature;foo",
"keyword": "Scenario Outline",
"line": 2,
"name": "foo",
"steps": [
{
"arguments": [],
"keyword": "Given ",
"line": 3,
"name": "a step",
"match": {
"location": "features/definitions.js:3"
},
"result": {
"status": "passed",
"duration": 306941
}
}
],
"tags": [],
"type": "scenario"
}
],
"id": "a-feature",
"line": 1,
"keyword": "Feature",
"name": "a feature",
"tags": [],
"uri": "features/foo.feature"
}
]
However, when piping the messages output through cucumber-json-formatter I get the following.
[
{
"description": "",
"elements": [
{
"description": "",
"id": "a-feature;\u003cvalue\u003e;;2",
"keyword": "Scenario Outline",
"line": 6,
"name": "\u003cvalue\u003e",
"steps": [
{
"keyword": "Given ",
"line": 3,
"name": "a step",
"result": {
"duration": 306941,
"status": "passed"
},
"match": {
"location": "features/definitions.js:3"
}
}
],
"type": "scenario"
}
],
"id": "a-feature",
"keyword": "Feature",
"line": 1,
"name": "a feature",
"uri": "features/foo.feature"
}
]
Notice the diff (using json-diff), IE. the parameter in the name property has not been replaced with the value.
[
{
- tags: [
- ]
elements: [
{
- tags: [
- ]
- id: "a-feature;foo"
+ id: "a-feature;<value>;;2"
- line: 2
+ line: 6
- name: "foo"
+ name: "<value>"
steps: [
{
- arguments: [
- ]
}
]
}
]
}
]
📦 Which tool/library version are you using?
- cucumber-js: 8.5.1
- cucumber-json-formatter: 19.0.0
🔬 How could we reproduce it?
Steps to reproduce the behavior:
git clone https://github.com/badeball/reproducible-issues.gitcd reproducible-issues/cucumber/outline-name-parameternpx @cucumber/cucumbernpx json-diff report.json <(cat report.ndjson | cucumber-json-formatter)
Hi -- Would like to know if this issue will be fixed in next release ? ... We are using this json for Rally test case generation, test result update
Cucumber is an open source project and mostly runs on volunteers.
Now it appears that nobody has been interested yet in providing a solution. Unless you are interested in providing this solution it is unlikely to happen at all.
Though you may also want to consider upgrading your tooling to use the ndjson output from the message formatter directly instead.
@mpkorstanje - Is it possible if you can elaborate more on - upgrading your tooling to use the ndjson output from the message formatter directly instead.
Still facing this isse and tried multiple ways but not able to resolve it.