Forum Discussion

ripplegupta's avatar
ripplegupta
Contributor
9 years ago

How to get reporting at test step level instead of test case level what surefire currently provides

I am running my test via jenkins and i have surefire plugin which generates xml reports in my workspace.

But this report has run status of all test suites and all test cases.

Each test case will have failed test step information too.

 

I want a way by which i can have run status of each test step whether failed or passed.

 

Can some one help here if we can do this with surefire plugin or with some other way/plugin.

 

Thanks a lot.

7 Replies

  • This script will work for the sample provided and can be easily adapted.

     

    
    // get test response as json
    def json = new groovy.json.JsonSlurper().parseText(context.response)
    // build array of the result list, specifically the proceduresId element
    def array = json.result.list.proceduresId;
    
    // a quick test if an array is sorted is to compare it to its sorted self. 
    // FALSE means make a copy of the array and sort it, instead of sorting the original object
    assert (array == array.sort(false));