cucumber-reporting
cucumber-reporting copied to clipboard
Object Element which represent scenario has empty Tag[] tags field
Object Element which represent scenario has empty Tag[] tags field. It doesn't collect information about tags in scenario
Attach JSON file
Attach JSON file
cucumber-report.json file has information about tags for elements and feature. But object Element has empty array 'tags'. Can't attach JSON file because github doesn't support that file type.
I have generated report from attached report and I see tags assigned to features and scenarios
Tags presents in report but on object's level Element has empty Tag[] tags field. I need it because I want to get information about test run results and update TestRail run based on it. So, that is why I get access to ReportBuilder object using Java reflection and work with ReportResult object. And object Element has empty Tag[] tags field. I have a screenshot but I can't attach it to this issue
Sorry the problem is not clear
Object Element which represent scenario has empty Tag[] tags field. It doesn't collect information about tags in scenario https://www.dropbox.com/s/k67h1amcjy1ho02/2022-10-31%2013_03_45-Window.png?dl=0
Attach JSON here
JSON the same as above. So, there is no issue with JSON file. The issue only when we work with Element objects using Java reflection. You can try to generate any report put a break point and you will see that 'tags' field inside Element object will be empty. Looks like on Feature level you save tags but on Element level - no
private List<Feature> getFeatureListFromReportBuilder(ReportBuilder reportBuilder) {
Field reportResultField = requireNonNull(ReflectionUtils.findField(ReportBuilder.class, "reportResult"));
ReflectionUtils.makeAccessible(reportResultField);
ReportResult reportResult = (ReportResult) ReflectionUtils.getField(reportResultField, reportBuilder);
return Objects.nonNull(reportResult)
? reportResult.getAllFeatures()
: new ArrayList<>();
}
This is still not clear and based on report http://damianszczepanik.github.io/cucumber-html-reports/overview-tags.html elements/scenarios have tags assigned properly