incompatible cucumber json report between karate and cucumber

有些话、适合烂在心里 提交于 2021-01-28 07:43:52

问题


I am trying to import json results from karate tests into the AssertThat Jira plugin.

Importing works well with cucumber js 5.1.0, but fails using karate 0.9.2

Seems that the problem lies in AssertThat using the Feature's "name" in the json to correlate to its internal Feature names, and a difference between how karate and cucumber js use the "name" and "description" fields .

Cucumber js uses the Feature's name from the feature file itself e.g. a feature file with "Feature: test reporting" will generate a json with:

{
    "keyword": "Feature",
    "name": "test reporting",
    "description":"In order to do report tests\n  As a developer\n  I want to do reporting",
     .....
}

While karate uses the feature file name for the "name" and put the actual Feature in the "description":

{
    "keyword":"Feature"
    "name":"cats.feature",
    "description":"test reporting",
    .....
}

回答1:


We've added an extra flag -k which is optional and defaults to 'cucumber' but can be set to 'karate' for importing karate type results.

New client plugins version released (1.3) and documentation updated for further reference https://assertthat.atlassian.net/wiki/spaces/ABTM/pages/728105165/Integration+with+Test+Automation+Frameworks




回答2:


Yes, this is intentional because Karate is not a BDD framework and is designed for teams that work with API-s. We felt that the file-name was more meaningful and the Feature name can be left blank (although not recommended).

I don't see this as a priority (unless you can convince us otherwise) - so maybe you could try influence the "AssertThat" team to make a change, or expose a settings flag. Please note that there are no issues with other reports such as this and this and also see this thread.



来源:https://stackoverflow.com/questions/56491075/incompatible-cucumber-json-report-between-karate-and-cucumber

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!