Forum Discussion

Cata's avatar
Cata
Occasional Contributor
3 years ago

Control the report from ReadyApi through a Jenkins declarative pipeline script

Hi everyone,

I'm running a suite of ReadyApi tests on a Jenkins pipeline (related plugin already installed) and at the end of that run ReadyApi puts out a pdf report that is available on Jenkins.
Now I would like to know if there is some way to access that part of ReadyApi through Jenkins and do some things with that report (send it in an email, publish it, etc.) and I would like to know if it's possible to do that from within Jenkins's pipeline script.

Thanks,
Cata

  • Hi Cata,

     

    This is an example script my colleague dermotcanniffe shared that should help -  

     

    something along these lines - 

     

    stage('Test') {
      steps {
        // One or more steps need to be included within the steps block.
        SoapUIPro environment: 'PreProd',
        pathToProjectFile: 'C:\\Users\.......\TestComplete 14 Projects\\REST-Project-210-readyapi-project.xml',
        pathToTestrunner: 'C:\\Program Files\\SmartBear\\ReadyAPI-3.20.0\\bin',
        projectPassword: <object of type hudson.util.Secret>,
        testCase: 'TCGetOrder',
        testCaseTags: '',
        testSuite: 'Awesome Shopping Store v1 TestSuite 1',
        testSuiteTags: ''
        }
      post {
        always {
          // One or more steps need to be included within each condition's block.
          allure includeProperties: false,
          jdk: '',
          results: [[path: 'allure-results']]
        }
      } 

     

    In the past I would have used a "post build action" in Jenkins to grab the outputted report file.

    So for example I would generate the report in xml and parse that  - 

    There is also an Allure plugin - https://plugins.jenkins.io/allure-jenkins-plugin/ that you can integrate with to make everything look really nice...

    I did this in the Jenkins UI though.

     

    Ronan 

     

  • Hi Cata,

     

    This is an example script my colleague dermotcanniffe shared that should help -  

     

    something along these lines - 

     

    stage('Test') {
      steps {
        // One or more steps need to be included within the steps block.
        SoapUIPro environment: 'PreProd',
        pathToProjectFile: 'C:\\Users\.......\TestComplete 14 Projects\\REST-Project-210-readyapi-project.xml',
        pathToTestrunner: 'C:\\Program Files\\SmartBear\\ReadyAPI-3.20.0\\bin',
        projectPassword: <object of type hudson.util.Secret>,
        testCase: 'TCGetOrder',
        testCaseTags: '',
        testSuite: 'Awesome Shopping Store v1 TestSuite 1',
        testSuiteTags: ''
        }
      post {
        always {
          // One or more steps need to be included within each condition's block.
          allure includeProperties: false,
          jdk: '',
          results: [[path: 'allure-results']]
        }
      } 

     

    In the past I would have used a "post build action" in Jenkins to grab the outputted report file.

    So for example I would generate the report in xml and parse that  - 

    There is also an Allure plugin - https://plugins.jenkins.io/allure-jenkins-plugin/ that you can integrate with to make everything look really nice...

    I did this in the Jenkins UI though.

     

    Ronan 

     

    • Cata's avatar
      Cata
      Occasional Contributor

      Hi Ronan,

      Sorry for the late reply, I've been caught up with other things and I've put this on the back burner but I've managed to look into what you suggested and I like the idea.
      Thanks for the help!