Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate output of scenario outlined with parameterized name #25

Open
badeball opened this issue Aug 9, 2022 · 3 comments
Open

Inaccurate output of scenario outlined with parameterized name #25

badeball opened this issue Aug 9, 2022 · 3 comments

Comments

@badeball
Copy link
Member

badeball commented Aug 9, 2022

πŸ‘“ 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)
@mrsenzy
Copy link

mrsenzy commented Aug 25, 2022

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

@mpkorstanje
Copy link
Contributor

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.

@RankaPalak
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants