Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
This repository was archived by the owner on Jul 21, 2025. It is now read-only.

Inaccurate output of scenario outlined with parameterized nameΒ #25

@badeball

Description

@badeball

πŸ‘“ 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:

  1. git clone https://github.com/badeball/reproducible-issues.git
  2. cd reproducible-issues/cucumber/outline-name-parameter
  3. npx @cucumber/cucumber
  4. npx json-diff report.json <(cat report.ndjson | cucumber-json-formatter)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions