Customized test report with Jira and Xray

We could define one online report to know test status easily. here just setup some widget. use the below tech:

  1. Python
  2. Jira
  3. Xray
  4. Highcharts

Total Test Execution

Jira Rest API: https://xxxxxx/jira/rest/api/2/issue/ISR-11732

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
"customfield_10931": {
"count": 17,
"statuses": [
{
"id": 0,
"name": "PASS",
"description": "The test run has passed",
"isFinal": true,
"color": "#95C160",
"isNative": true,
"statusCount": 8,
"statusPercent": 47.05882352941177
},
{
"id": 3,
"name": "FAIL",
"description": "The test run has failed",
"isFinal": true,
"color": "#D45D52",
"isNative": true,
"statusCount": 1,
"statusPercent": 5.882352941176471
},
{
"id": 4,
"name": "ABORTED",
"description": "The test run was aborted",
"isFinal": true,
"color": "#111111",
"isNative": true,
"statusCount": 0,
"statusPercent": 0
},
{
"id": 1000,
"name": "N/A",
"description": "The test can't be executed or is not relevant",
"isFinal": true,
"color": "#000000",
"isNative": false,
"statusCount": 8,
"statusPercent": 47.05882352941177
},
{
"id": 2,
"name": "EXECUTING",
"description": "The test run is currently being executed",
"isFinal": false,
"color": "#F1E069",
"isNative": true,
"statusCount": 0,
"statusPercent": 0
},
{
"id": 1001,
"name": "BLOCKED",
"description": "The test run is currently blocked",
"isFinal": false,
"color": "#1F39B8",
"isNative": false,
"statusCount": 0,
"statusPercent": 0
},
{
"id": 1,
"name": "TODO",
"description": "The test run has not started",
"isFinal": false,
"color": "#A2A6AE",
"isNative": true,
"statusCount": 0,
"statusPercent": 0
}
]
}

Test Execution Summary

Xray Rest API: https://xxxxxx/jira/rest/raven/1.0/api/testexec/ISR-11759/test

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
[
{
"id": 4389836,
"status": "PASS",
"key": "ISR-10928",
"rank": 1
},

{
"id": 4389837,
"status": "PASS",
"key": "ISR-10927",
"rank": 2
},

{
"id": 4389838,
"status": "PASS",
"key": "ISR-10926",
"rank": 3
},

{
"id": 4389839,
"status": "PASS",
"key": "ISR-10925",
"rank": 4
},

{
"id": 4389840,
"status": "PASS",
"key": "ISR-10935",
"rank": 5
},

{
"id": 4389841,
"status": "PASS",
"key": "ISR-10934",
"rank": 6
},

{
"id": 4389842,
"status": "PASS",
"key": "ISR-10933",
"rank": 7
},

{
"id": 4389843,
"status": "PASS",
"key": "ISR-10932",
"rank": 8
},

{
"id": 4389844,
"status": "PASS",
"key": "ISR-10931",
"rank": 9
},

{
"id": 4389845,
"status": "PASS",
"key": "ISR-10930",
"rank": 10
},

{
"id": 4389846,
"status": "PASS",
"key": "ISR-10938",
"rank": 11
},

{
"id": 4389847,
"status": "FAIL",
"key": "ISR-10937",
"rank": 12
}

]

Test Active Defect

Jira Rest API: https://xxxxxx/jira/rest/api/2/search?jql=status not in (Closed, Resolved) AND issue in defectsCreatedDuringTestExecution(ISR-11759)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"expand": "names,schema",
"startAt": 0,
"maxResults": 50,
"total": 1,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "5925696",
"self": "https://xxxxxx/jira/rest/api/2/issue/5925696",
"key": "ISR-11944",
"fields": {
"priority": {
"self": "https://xxxxxx/jira/rest/api/2/priority/4",
"iconUrl": "https://xxxxxx/jira/images/icons/priorities/low.svg",
"name": "Low",
"id": "4"
}

}

}

]
}

Report:

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!