Forum Discussion

WilliamU's avatar
WilliamU
New Contributor
11 years ago

Test suite report via groovy

I have a teardown script right now that grabs the status of the test suite and sends out an email with it. I would like to expand on this by putting an HTML summary of this suite in the body of the email. The HTML summary would be of the type that SoapUI generates (as in I do not want to iterate through my test cases, check status, and build html myself). Is there a way to access SoapUI's reporting capabilities from groovy? I have tried putting
import com.eviware.soapui.report.JUnitReportCollector
context.collector = JUnitReportCollector.createNew(11)
in the Setup and then accessing it from the teardown. This gives me a nice looking empty SoapUI report on disk. Obviously I don't want it to be empty, and I would prefer to just have the report as a groovy object I can toString() and put in the body (instead of writing the report to disk, then reading the file, shoving it into the email, then deleting the file). Thank you for your help!

4 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Normally we don't provide support for groovy scripts, but I can point you in the right direction. Creating HTML reports is done with the createReport. That gives you a string that you can work with and just put in your email.

    Regards,
    Arian
    SmartBear Sweden
  • WilliamU's avatar
    WilliamU
    New Contributor
    By "Normally we don't provide support for groovy scripts", do you mean for any of your java librarys? In my opinion this is about how soap specific methods work and not about groovy as a language. I'm doing
    context.collector = new JUnitReportCollector(11)
    testSuite.addTestSuiteRunListener(context.collector)
    in the setup and
    log.info(context.collector.getReport())
    in the teardown. I get a string of "No reports..:". What venue would you recommend I discuss these problems on?