Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
YevhenPiskun opened this issue Oct 31, 2022 · 10 comments
Open

Comments

@YevhenPiskun
Copy link

YevhenPiskun commented Oct 31, 2022

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

@damianszczepanik
Copy link
Owner

Attach JSON file

@YevhenPiskun
Copy link
Author

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
Copy link
Author

cucumber-report.txt

@damianszczepanik
Copy link
Owner

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

@YevhenPiskun
Copy link
Author

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

@damianszczepanik
Copy link
Owner

Sorry the problem is not clear

@YevhenPiskun
Copy link
Author

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

@damianszczepanik
Copy link
Owner

Attach JSON here

@YevhenPiskun
Copy link
Author

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

@damianszczepanik
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants