cucumber-reporting icon indicating copy to clipboard operation
cucumber-reporting copied to clipboard

Object Element which represent scenario has empty Tag[] tags field

Open YevhenPiskun opened this issue 2 years ago • 10 comments

Object Element which represent scenario has empty Tag[] tags field. It doesn't collect information about tags in scenario

YevhenPiskun avatar Oct 31 '22 10:10 YevhenPiskun

Attach JSON file

damianszczepanik avatar Oct 31 '22 21:10 damianszczepanik

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.

YevhenPiskun avatar Nov 01 '22 10:11 YevhenPiskun

I have generated report from attached report and I see tags assigned to features and scenarios obraz

damianszczepanik avatar Nov 02 '22 22:11 damianszczepanik

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

YevhenPiskun avatar Nov 04 '22 09:11 YevhenPiskun

Sorry the problem is not clear

damianszczepanik avatar Nov 04 '22 20:11 damianszczepanik

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

YevhenPiskun avatar Nov 07 '22 09:11 YevhenPiskun

Attach JSON here

damianszczepanik avatar Nov 10 '22 20:11 damianszczepanik

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<>();
    }

YevhenPiskun avatar Nov 14 '22 09:11 YevhenPiskun

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

damianszczepanik avatar Nov 14 '22 22:11 damianszczepanik