webdriverio-community/wdio-cucumberjs-json-reporter

Report contains a scenario with the type "feature"

VitaliLebedzeu opened this issue · 9 comments

When I've updated the "wdio-cucumberjs-json-reporter version" to 4.1.2 version, the report became to include the "feature" as a scenario.

Environment (please complete the following information):

  • Node.js version: [14.17.6]
  • NPM version: [6.14.15]
  • webdriver.io version: [7.12.6]
  • @wdio/cucumber-framework version: [7.12.5]
  • wdio-cucumberjs-json-reporter version: [4.1.2]

The report from the "wdio-cucumberjs-json-reporter"

[
  {
    "keyword": "Feature",
    "type": "feature",
    "description": "",
    "line": null,
    "name": "RGO-913 Re-Optimization Home Screen V1",
    "uri": "Can not be determined",
    "tags": [],
    "elements": [
      {
        "keyword": "Scenario",
        "type": "feature",
        "description": "",
        "name": "RGO-913 Re-Optimization Home Screen V1",
        "tags": [],
        "id": "rgo-913-re-optimization-home-screen-v1;rgo-913-re-optimization-home-screen-v1",
        "steps": []
      },
      {
        "keyword": "Scenario",
        "type": "scenario",
        "description": "",
        "name": "RGOQ-271 Navigation from Home screen Open Proposals to Promotion Details page",
        "tags": [
          {
            "name": "@RGOQ-271",
            "astNodeId": "8"
          },
      ...

As I realized because of this "feature" fails the possibility to import the JSON report to the JIRA
image

The structure of the JSON report looks valid, but no one can't parse it correctly
image

Yeah, some help would be appreciated. If someone can provide a link to the valid Cucumber JSON structure then that would be an entry point to pick this up

This issue appears in version 4.0.0

report from v.3.0.0. - without this issue

[
  {
    "keyword": "Feature",
    "type": "feature",
    "description": "",
    "line": 0,
    "name": "RGO-913",
    "uri": "Can not be determined",
    "tags": [],
    "elements": [
      {
        "keyword": "Scenario",
        "type": "scenario",
        "description": "",
        "name": "RGOQ-269",
        "tags": [
          {
            "name": "@RGOQ-269",
            "astNodeId": "3"
          },
          {
            "name": "@UI",
            "astNodeId": "4"
          },
          {
            "name": "@only",
            "astNodeId": "5"
          }
        ],
        "id": "rgo-913;rgoq-269",
        "line": 0,
        "steps": [
          {
            "arguments": [],
            "keyword": "Before",
            "name": "",
            "result": {
              "status": "passed",
              "duration": 40000000
            },
            "line": 126,
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "When",
            "name": "log in to the RGO application as \"Default\" role",
            "result": {
              "status": "passed",
              "duration": 15288000000
            },
            "line": 18,
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "And",
            "name": "select option \"Your Promotions Plans\" in the list \"content.quickLinks\"",
            "result": {
              "status": "passed",
              "duration": 334000000
            },
            "line": 19,
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "Then",
            "name": "work with page \"PromotionPlansPage\"",
            "result": {
              "status": "passed",
              "duration": 3487000000
            },
            "line": 20,
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "After",
            "name": "",
            "result": {
              "status": "passed",
              "duration": 11000000
            },
            "line": 130,
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          }
        ]
      }
    ],
    "id": "rgo-913",
    "metadata": {
      "browser": {
        "name": "chrome",
        "version": "93.0.4577.82"
      },
      "device": "Device name not known",
      "platform": {
        "name": "Platform name not known",
        "version": "Version not known"
      }
    }
  }
]

report from v.4.0.0. with issue

[
  {
    "keyword": "Feature",
    "type": "feature",
    "description": "",
    "line": null,
    "name": "RGO-913",
    "uri": "Can not be determined",
    "tags": [],
    "elements": [
      {
        "keyword": "Scenario",
        "type": "feature",
        "description": "",
        "name": "RGO-913",
        "tags": [],
        "id": "rgo-913;rgo-913",
        "steps": []
      },
      {
        "keyword": "Scenario",
        "type": "scenario",
        "description": "",
        "name": "RGOQ-269",
        "tags": [
          {
            "name": "@RGOQ-269",
            "astNodeId": "3"
          },
          {
            "name": "@UI",
            "astNodeId": "4"
          },
          {
            "name": "@only",
            "astNodeId": "5"
          }
        ],
        "id": "rgo-913;rgoq-269",
        "steps": [
          {
            "arguments": [],
            "keyword": "Before",
            "name": "",
            "result": {
              "status": "passed",
              "duration": 28000000
            },
            "line": 126,
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "When",
            "name": "log in to the RGO application as \"Default\" role",
            "result": {
              "status": "passed",
              "duration": 14762000000
            },
            "line": "",
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "And",
            "name": "select option \"Your Promotions Plans\" in the list \"content.quickLinks\"",
            "result": {
              "status": "passed",
              "duration": 322000000
            },
            "line": "",
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "Then",
            "name": "work with page \"PromotionPlansPage\"",
            "result": {
              "status": "passed",
              "duration": 3183000000
            },
            "line": "",
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          },
          {
            "arguments": [],
            "keyword": "After",
            "name": "",
            "result": {
              "status": "passed",
              "duration": 73000000
            },
            "line": 130,
            "match": {
              "location": "can not be determined with webdriver.io"
            }
          }
        ]
      }
    ],
    "id": "rgo-913",
    "metadata": {
      "browser": {
        "name": "chrome",
        "version": "93.0.4577.82"
      },
      "device": "Device name not known",
      "platform": {
        "name": "Platform name not known",
        "version": "Version not known"
      }
    }
  }
]

As we can see first feature's scenario is a feature as the scenario with type "feature"

I found the issue, will fix this in a next release which will be this week

I've release https://github.com/webdriverio-community/wdio-cucumberjs-json-reporter/releases/tag/v4.1.4 can you please test and let me know of if it now works

I've release https://github.com/webdriverio-community/wdio-cucumberjs-json-reporter/releases/tag/v4.1.4 can you please test and let me know of if it now works

The report looks well!
Many thanks.
Best regards!