Viewing the Coverage Report Method

To view the coverage of your test runs, send a POST request to the coverage report endpoint, passing in the modelName and group name parameters. You can restrict which runs are used to calculate the coverage by passing in from and to dates in the format YYYY-MM-DD with an optional HH:MM:SS. There are two other parameters that are important: temporalDepth and crossDepth.

The temporalDepth parameter determines how many paths deep you want your coverage to be based on—for example, a temporal depth of three would track all possible three-path scenarios. If a state has two actions, Action A and Action B, in the coverage report, you would see paths like Action A > Action B > Action A, and all other permutations. This gives a more meaningful answer as to which path combinations were covered in your tests. The crossDepth parameter deals with variable value combinations and which combinations were hit when values were generated.

The default value for both the temporalDepth and crossDepth parameters is two, but this can be increased. Care must be taken not to increase too high, as the computation time grows exponentially.

Method

POST -> http://localhost/api/coverage/report

Headers

Name Value
Authorization bearer <access_token>
Content-Type application/x-www-form-urlencoded

Body Parameters

Name Type Required
modelName Text Yes
group Text Yes
crossDepth Integer No
temporalDepth Integer No

Possible Responses

Status Status Text Description
200 OK  
401 Unauthorized The access token was not valid
403 Forbidden The current user doesn’t have access to the model requested

Response Body JSON

{

"date": "2018-06-01 14:30:01.646064+01",

"testCount": "6",

"passCount": "6",

"failCount": "0",

"hierarchyId": "4159",

"coverage": "0.916666687",

"report": [

{

"name": "BBCSport",

"coverage": "0.916666687",

"kind": "Test",

"items": [

{

"name": "Rotate",

"coverage": "1",

"kind": "Action",

"hitCount": "5"

},

{

"name": "Initial",

"coverage": "0.833333313",

"kind": "State",

"hitCount": "6",

"items": [

{

"name": "Open Chrome",

"coverage": "0.75",

"kind": "Action",

"hitCount": "6",

"items": [

{

"name": "Browser open",

"coverage": "6",

"kind": "Connection"

},

{

"name": "Open Chrome->Rotate",

"coverage": "0",

"kind": "Path"

},

{

"name": "Open Chrome->Navigate to BBC Sport Website",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "Initial->Browser open",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "Browser open",

"coverage": "0.833333313",

"kind": "State",

"hitCount": "6",

"items": [

{

"name": "Navigate to BBC Sport Website",

"coverage": "0.75",

"kind": "Action",

"hitCount": "6",

"items": [

{

"name": "BBC Sport Home Pages",

"coverage": "6",

"kind": "Connection"

},

{

"name": "Navigate to BBC Sport Website->Rotate",

"coverage": "0",

"kind": "Path"

},

{

"name": "Navigate to BBC Sport Website->Football",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "Browser open->BBC Sport Home Pages",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "BBC Sport Home Pages",

"coverage": "1",

"kind": "State",

"hitCount": "6",

"items": [

{

"name": "Football",

"coverage": "1",

"kind": "Action",

"hitCount": "6",

"items": [

{

"name": "football page",

"coverage": "6",

"kind": "Connection"

},

{

"name": "Football->Rotate",

"coverage": "2",

"kind": "Path"

},

{

"name": "Football->View league tables",

"coverage": "4",

"kind": "Path"

}

]

},

{

"name": "BBC Sport Home Pages->football page",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "football page",

"coverage": "0.833333313",

"kind": "State",

"hitCount": "6",

"items": [

{

"name": "View league tables",

"coverage": "0.75",

"kind": "Action",

"hitCount": "6",

"items": [

{

"name": "Tables page",

"coverage": "6",

"kind": "Connection"

},

{

"name": "View league tables->Rotate",

"coverage": "0",

"kind": "Path"

},

{

"name": "View league tables->Check for united",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "football page->Tables page",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "Tables page",

"coverage": "1",

"kind": "State",

"hitCount": "6",

"items": [

{

"name": "Check for united",

"coverage": "1",

"kind": "Action",

"hitCount": "6",

"items": [

{

"name": "Finish",

"coverage": "6",

"kind": "Connection"

},

{

"name": "Check for united->Rotate",

"coverage": "2",

"kind": "Path"

},

{

"name": "Check for united->Action7",

"coverage": "4",

"kind": "Path"

}

]

},

{

"name": "Tables page->Finish",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "Finish",

"coverage": "1",

"kind": "State",

"hitCount": "6",

"items": [

{

"name": "Action7",

"coverage": "1",

"kind": "Action",

"hitCount": "6",

"items": [

{

"name": "Exit",

"coverage": "6",

"kind": "Connection"

}

]

},

{

"name": "Finish->Exit",

"coverage": "6",

"kind": "Path"

}

]

},

{

"name": "Exit",

"coverage": "1",

"kind": "State",

"hitCount": "6"

}

]

}

],

"breakdown": {

"states": {

"count": "7",

"hitCount": "7"

},

"actions": {

"count": "7",

"hitCount": "7"

},

"paths": {

"count": "16",

"hitCount": "13"

}

},

"textReport": "================================================================================\nInfo\n================================================================================\nCMD: --coverdb ttdb --models BBCSport --group martin.dann@eggplant.io --temporalDepth 2 --crossDepth 2\nDate: 2018-06-01 14:30:01.646064+01\nModel: BBCSport\nResults: 6 total, 6 pass, 0 fail, 100.00% pass rate\n\n================================================================================\nStates Coverage Summary\n================================================================================\nInitial.................................................................. 83.33%\nBrowser open............................................................. 83.33%\nBBC Sport Home Pages.....................................................100.00%\nfootball page............................................................ 83.33%\nTables page..............................................................100.00%\nFinish...................................................................100.00%\nExit.....................................................................100.00%\n\n================================================================================\nStates Coverage Detail\n================================================================================\n* Global\n (A) Rotate.............................................................100.00%\n* Initial, 83.33%, 6\n (A) Open Chrome........................................................ 75.00%\n* Browser open, 83.33%, 6\n (A) Navigate to BBC Sport Website...................................... 75.00%\n* BBC Sport Home Pages, 100.00%, 6\n (A) Football...........................................................100.00%\n* football page, 83.33%, 6\n (A) View league tables................................................. 75.00%\n* Tables page, 100.00%, 6\n (A) Check for united...................................................100.00%\n* Finish, 100.00%, 6\n (A) Action7............................................................100.00%\n* Exit, 100.00%, 6\n\n================================================================================\nAction Coverage Detail\n================================================================================\n* Rotate, Global, 100.00%, 5\n* Open Chrome, Initial, 75.00%, 6\n* Navigate to BBC Sport Website, Browser open, 75.00%, 6\n* Football, BBC Sport Home Pages, 100.00%, 6\n* View league tables, football page, 75.00%, 6\n* Check for united, Tables page, 100.00%, 6\n* Action7, Finish, 100.00%, 6\n\n"

}

The data coming back from the coverage report is organized into a hierarchy with some top-level data like test count, pass count, fail count, hierarchy id, and date, then a report property containing a hierarchy of your model with coverage values associated. All child objects are nested within the root object. All states and global actions will be children of the model node itself via the items property. There will be child actions within states and then children of the action objects will be things like connection paths and variables. Any object that has child objects will have an items property containing a list of objects. Each object has a name, a kind, a hitCount and a coverage value.

There is a breakdown object, which gives an overall coverage report for the model, and there is also a text report returned.

 

This topic was last updated on July 09, 2020, at 01:18:46 PM.

Eggplant icon Eggplantsoftware.com | Documentation Home | User Forums | Support | Copyright © 2020 Eggplant