Forum Discussion

KarelHusa's avatar
KarelHusa
Champion Level 3
2 years ago

How to set single-page JUnit report format in Groovy script

I want to generate a single-page JUnit report from a Groovy script.

I am able to use JUnitReportEngine and generate a multiple-pages report, which is the default format.

However, I am not able to set SINGLE_PAGE_PRINT_REPORT_FORMAT.

 

There's no appropriate parameter in constructor, I have also tried to set it up in GeneratableJUnitReport method generate as a jrFormats parameter:

 

generate(Settings settings, java.lang.String[] jrFormats, java.lang.String folder)

In the SDK (links above) there's no documentation how to do that.

 

Can you please advise?

 

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    KarelHusa , Are there any customizations and that's why trying to generate report using Script?

    So, multi page report is default. Right?

     

    Never tried any customization in the report.However, used to generate Junit report in xml and applying style sheet (which i got from some where, don't remember though) to generate html reports in open source.

     

    By the way, what command do you use while executing the tests (if on command line to execute the tests and generate the report)?

     

    Noticed there is a configuration in the settings.xml as below. May be you might have noticed.

    <con:setting id="GeneratableJUnitReport@Style">Multiple Pages</con:setting>

     

     

    • KarelHusa's avatar
      KarelHusa
      Champion Level 3

      nmrao, I wanted to generate the report from listeners, i.e., controlling the report completely from Groovy, as part of test automation.