Warm tip: This article is reproduced from serverfault.com, please click

Missing feature title while exporting cucumber feature to .feature file in Xray?

发布于 2020-12-04 08:02:11

While exporting the cucumber file (feature) from Xray Test Execution I recently notice that the feature name is missing (it should be imported from test/task name?)

> @XYZ-1234 Feature:
> 
>   #description    @XYZ-1234 @XYZ-1234 @XYZ-1234 @Tag_name
>   Scenario: Lorem ipsum dolor sit amet
>       Given Consectetur adipiscing elit
>       Then  Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

Is there any possibility to add a feature name in Xray?

When you generate a JSON report via wdio-cucumberjs-json-reporter package then JSON doesn't have a name, just ".json", when I add a feature name like shown below it works fine but the features will be exported via CI/CD so I need to point out the right JSON with the correct name.

> @XYZ-1234 Feature: Added title manually
> 
>   #description    @XYZ-1234 @XYZ-1234 @XYZ-1234 @Tag_name
>   Scenario: Lorem ipsum dolor sit amet
>       Given Consectetur adipiscing elit
>       Then  Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

Is there any solution to resolve that case? Thanks in advance.

Questioner
beauvoir
Viewed
0
Sérgio 2020-12-08 21:07:51

In order to populate the "Feature: " field, you need to have Tests in Xray linked to "requirements" (i.e issues that can be covered with Tests). Those "requirement" issues need to have one of the issue types configured to be handled as "requirements as detailed in the documentation

The rules for generating the .feature files are detailed here

Btw, in the recent Xray v4.2.3, Xray will autofill the Feature: section with a default name if your Test scenarios are not linked to a "requirement"; more info here.