damianszczepanik / cucumber-reporting

HTML reports for Cucumber
GNU Lesser General Public License v2.1
546 stars 402 forks source link

Why cucumber report displays rows for all tags? #812

Closed jaridiv closed 5 years ago

jaridiv commented 5 years ago

Please look at stack overflow issue - https://stackoverflow.com/questions/54426416/karate-cucumber-report-why-cucumber-report-displays-rows-for-all-tags

Why cucumber report (Tags Tab) displays rows for all tags which are added at feature level, but not limited to tags passed at part of cucumber run command ?

I know net.masterthought.cucumber.Configuration has method setTagsToExcludeFromChart to exclude tags from chart, but could not find a way to exclude tags from tags table.

damianszczepanik commented 5 years ago

Provide JSON file with valid and invalid tag

jaridiv commented 5 years ago

I'm using cucumber report library with Karate. I had created issue in Karate project - https://github.com/intuit/karate/issues/665 It was closed because it may be the issue with cucumber report library, not karate.

Here is JSON:

[
  {
    "line": 2,
    "elements": [
      {
        "line": 4,
        "name": "",
        "description": "",
        "type": "background",
        "keyword": "Background",
        "steps": [
          {
            "name": "url 'https://jsonplaceholder.typicode.com'",
            "result": {
              "duration": 1673847,
              "status": "passed"
            },
            "match": {
              "location": "karate",
              "arguments": []
            },
            "keyword": "*",
            "line": 5,
            "doc_string": {
              "content_type": "",
              "value": "17:56:07.310 karate.env system property was: null",
              "line": 5
            }
          }
        ]
      },
      {
        "line": 7,
        "name": "get all users",
        "description": "",
        "id": "get-all-users",
        "type": "scenario",
        "keyword": "Scenario",
        "steps": [
          {
            "name": "path 'users'",
            "result": {
              "duration": 1503231,
              "status": "passed"
            },
            "match": {
              "location": "karate",
              "arguments": []
            },
            "keyword": "Given",
            "line": 9
          },
          {
            "name": "method get",
            "result": {
              "duration": 605496929,
              "status": "passed"
            },
            "match": {
              "location": "karate",
              "arguments": []
            },
            "keyword": "When",
            "line": 10,
            "doc_string": {
              "content_type": "",
              "value": "17:56:07.593 request:\n1 > GET https://jsonplaceholder.typicode.com/users\n1 > Accept-Encoding: gzip,deflate\n1 > Connection: Keep-Alive\n1 > Host: jsonplaceholder.typicode.com\n1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_172)\n\n17:56:07.892 response time in milliseconds: 295.65\n1 < 200\n1 < Access-Control-Allow-Credentials: true\n1 < CF-Cache-Status: HIT\n1 < CF-RAY: 4af600cdbd29c54e-ORD\n1 < Cache-Control: public, max-age=14400\n1 < Connection: keep-alive\n1 < Content-Type: application/json; charset=utf-8\n1 < Date: Tue, 26 Feb 2019 22:56:07 GMT\n1 < Etag: W/\"160d-1eMSsxeJRfnVLRBmYJSbCiJZ1qQ\"\n1 < Expect-CT: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"\n1 < Expires: Wed, 27 Feb 2019 02:56:07 GMT\n1 < Pragma: no-cache\n1 < Server: cloudflare\n1 < Set-Cookie: __cfduid=dd5156192403e41fbe5ba8805561b33111551221767; expires=Wed, 26-Feb-20 22:56:07 GMT; path=/; domain=.typicode.com; HttpOnly\n1 < Transfer-Encoding: chunked\n1 < Vary: Origin, Accept-Encoding\n1 < Via: 1.1 vegur\n1 < X-Content-Type-Options: nosniff\n1 < X-Powered-By: Express\n[\n  {\n    \"id\": 1,\n    \"name\": \"Leanne Graham\",\n    \"username\": \"Bret\",\n    \"email\": \"Sincere@april.biz\",\n    \"address\": {\n      \"street\": \"Kulas Light\",\n      \"suite\": \"Apt. 556\",\n      \"city\": \"Gwenborough\",\n      \"zipcode\": \"92998-3874\",\n      \"geo\": {\n        \"lat\": \"-37.3159\",\n        \"lng\": \"81.1496\"\n      }\n    },\n    \"phone\": \"1-770-736-8031 x56442\",\n    \"website\": \"hildegard.org\",\n    \"company\": {\n      \"name\": \"Romaguera-Crona\",\n      \"catchPhrase\": \"Multi-layered client-server neural-net\",\n      \"bs\": \"harness real-time e-markets\"\n    }\n  },\n  {\n    \"id\": 2,\n    \"name\": \"Ervin Howell\",\n    \"username\": \"Antonette\",\n    \"email\": \"Shanna@melissa.tv\",\n    \"address\": {\n      \"street\": \"Victor Plains\",\n      \"suite\": \"Suite 879\",\n      \"city\": \"Wisokyburgh\",\n      \"zipcode\": \"90566-7771\",\n      \"geo\": {\n        \"lat\": \"-43.9509\",\n        \"lng\": \"-34.4618\"\n      }\n    },\n    \"phone\": \"010-692-6593 x09125\",\n    \"website\": \"anastasia.net\",\n    \"company\": {\n      \"name\": \"Deckow-Crist\",\n      \"catchPhrase\": \"Proactive didactic contingency\",\n      \"bs\": \"synergize scalable supply-chains\"\n    }\n  },\n  {\n    \"id\": 3,\n    \"name\": \"Clementine Bauch\",\n    \"username\": \"Samantha\",\n    \"email\": \"Nathan@yesenia.net\",\n    \"address\": {\n      \"street\": \"Douglas Extension\",\n      \"suite\": \"Suite 847\",\n      \"city\": \"McKenziehaven\",\n      \"zipcode\": \"59590-4157\",\n      \"geo\": {\n        \"lat\": \"-68.6102\",\n        \"lng\": \"-47.0653\"\n      }\n    },\n    \"phone\": \"1-463-123-4447\",\n    \"website\": \"ramiro.info\",\n    \"company\": {\n      \"name\": \"Romaguera-Jacobson\",\n      \"catchPhrase\": \"Face to face bifurcated interface\",\n      \"bs\": \"e-enable strategic applications\"\n    }\n  },\n  {\n    \"id\": 4,\n    \"name\": \"Patricia Lebsack\",\n    \"username\": \"Karianne\",\n    \"email\": \"Julianne.OConner@kory.org\",\n    \"address\": {\n      \"street\": \"Hoeger Mall\",\n      \"suite\": \"Apt. 692\",\n      \"city\": \"South Elvis\",\n      \"zipcode\": \"53919-4257\",\n      \"geo\": {\n        \"lat\": \"29.4572\",\n        \"lng\": \"-164.2990\"\n      }\n    },\n    \"phone\": \"493-170-9623 x156\",\n    \"website\": \"kale.biz\",\n    \"company\": {\n      \"name\": \"Robel-Corkery\",\n      \"catchPhrase\": \"Multi-tiered zero tolerance productivity\",\n      \"bs\": \"transition cutting-edge web services\"\n    }\n  },\n  {\n    \"id\": 5,\n    \"name\": \"Chelsey Dietrich\",\n    \"username\": \"Kamren\",\n    \"email\": \"Lucio_Hettinger@annie.ca\",\n    \"address\": {\n      \"street\": \"Skiles Walks\",\n      \"suite\": \"Suite 351\",\n      \"city\": \"Roscoeview\",\n      \"zipcode\": \"33263\",\n      \"geo\": {\n        \"lat\": \"-31.8129\",\n        \"lng\": \"62.5342\"\n      }\n    },\n    \"phone\": \"(254)954-1289\",\n    \"website\": \"demarco.info\",\n    \"company\": {\n      \"name\": \"Keebler LLC\",\n      \"catchPhrase\": \"User-centric fault-tolerant solution\",\n      \"bs\": \"revolutionize end-to-end systems\"\n    }\n  },\n  {\n    \"id\": 6,\n    \"name\": \"Mrs. Dennis Schulist\",\n    \"username\": \"Leopoldo_Corkery\",\n    \"email\": \"Karley_Dach@jasper.info\",\n    \"address\": {\n      \"street\": \"Norberto Crossing\",\n      \"suite\": \"Apt. 950\",\n      \"city\": \"South Christy\",\n      \"zipcode\": \"23505-1337\",\n      \"geo\": {\n        \"lat\": \"-71.4197\",\n        \"lng\": \"71.7478\"\n      }\n    },\n    \"phone\": \"1-477-935-8478 x6430\",\n    \"website\": \"ola.org\",\n    \"company\": {\n      \"name\": \"Considine-Lockman\",\n      \"catchPhrase\": \"Synchronised bottom-line interface\",\n      \"bs\": \"e-enable innovative applications\"\n    }\n  },\n  {\n    \"id\": 7,\n    \"name\": \"Kurtis Weissnat\",\n    \"username\": \"Elwyn.Skiles\",\n    \"email\": \"Telly.Hoeger@billy.biz\",\n    \"address\": {\n      \"street\": \"Rex Trail\",\n      \"suite\": \"Suite 280\",\n      \"city\": \"Howemouth\",\n      \"zipcode\": \"58804-1099\",\n      \"geo\": {\n        \"lat\": \"24.8918\",\n        \"lng\": \"21.8984\"\n      }\n    },\n    \"phone\": \"210.067.6132\",\n    \"website\": \"elvis.io\",\n    \"company\": {\n      \"name\": \"Johns Group\",\n      \"catchPhrase\": \"Configurable multimedia task-force\",\n      \"bs\": \"generate enterprise e-tailers\"\n    }\n  },\n  {\n    \"id\": 8,\n    \"name\": \"Nicholas Runolfsdottir V\",\n    \"username\": \"Maxime_Nienow\",\n    \"email\": \"Sherwood@rosamond.me\",\n    \"address\": {\n      \"street\": \"Ellsworth Summit\",\n      \"suite\": \"Suite 729\",\n      \"city\": \"Aliyaview\",\n      \"zipcode\": \"45169\",\n      \"geo\": {\n        \"lat\": \"-14.3990\",\n        \"lng\": \"-120.7677\"\n      }\n    },\n    \"phone\": \"586.493.6943 x140\",\n    \"website\": \"jacynthe.com\",\n    \"company\": {\n      \"name\": \"Abernathy Group\",\n      \"catchPhrase\": \"Implemented secondary concept\",\n      \"bs\": \"e-enable extensible e-tailers\"\n    }\n  },\n  {\n    \"id\": 9,\n    \"name\": \"Glenna Reichert\",\n    \"username\": \"Delphine\",\n    \"email\": \"Chaim_McDermott@dana.io\",\n    \"address\": {\n      \"street\": \"Dayna Park\",\n      \"suite\": \"Suite 449\",\n      \"city\": \"Bartholomebury\",\n      \"zipcode\": \"76495-3109\",\n      \"geo\": {\n        \"lat\": \"24.6463\",\n        \"lng\": \"-168.8889\"\n      }\n    },\n    \"phone\": \"(775)976-6794 x41206\",\n    \"website\": \"conrad.com\",\n    \"company\": {\n      \"name\": \"Yost and Sons\",\n      \"catchPhrase\": \"Switchable contextually-based project\",\n      \"bs\": \"aggregate real-time technologies\"\n    }\n  },\n  {\n    \"id\": 10,\n    \"name\": \"Clementina DuBuque\",\n    \"username\": \"Moriah.Stanton\",\n    \"email\": \"Rey.Padberg@karina.biz\",\n    \"address\": {\n      \"street\": \"Kattie Turnpike\",\n      \"suite\": \"Suite 198\",\n      \"city\": \"Lebsackbury\",\n      \"zipcode\": \"31428-2261\",\n      \"geo\": {\n        \"lat\": \"-38.2386\",\n        \"lng\": \"57.2232\"\n      }\n    },\n    \"phone\": \"024-648-3804\",\n    \"website\": \"ambrose.net\",\n    \"company\": {\n      \"name\": \"Hoeger LLC\",\n      \"catchPhrase\": \"Centralized empowering task-force\",\n      \"bs\": \"target end-to-end models\"\n    }\n  }\n]",
              "line": 10
            }
          },
          {
            "name": "status 200",
            "result": {
              "duration": 14747,
              "status": "passed"
            },
            "match": {
              "location": "karate",
              "arguments": []
            },
            "keyword": "Then",
            "line": 11
          }
        ]
      }
    ],
    "name": "examples/users/users.feature",
    "description": "sample karate test script",
    "id": "sample-karate-test-script",
    "keyword": "Feature",
    "uri": "examples/users/users.feature",
    "tags": [
      {
        "name": "@tag1",
        "line": 1
      },
      {
        "name": "@tag2",
        "line": 1
      }
    ]
  }
]

Additionally, you can look at the Karate Issue. Download sample project and run mvn command to generate cucumber report. Report will be generated under /build folder.

damianszczepanik commented 5 years ago

OK, now I understand the request. Yes it was done by design as implemented in #486 @aleitamar any comment about it?

damianszczepanik commented 5 years ago

Delivered, wait for next release