1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
xmlns:math="http://exslt.org/math"
|
4
|
xmlns:testng="http://testng.org">
|
5
|
|
6
|
<xsl:output method="html" indent="yes" omit-xml-declaration="yes"
|
7
|
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
8
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
|
9
|
<xsl:output name="text" method="text"/>
|
10
|
<xsl:output name="xml" method="xml" indent="yes"/>
|
11
|
<xsl:output name="html" method="html" indent="yes" omit-xml-declaration="yes"/>
|
12
|
<xsl:output name="xhtml" method="xhtml" indent="yes" omit-xml-declaration="yes"/>
|
13
|
|
14
|
<xsl:param name="testNgXslt.outputDir"/>
|
15
|
<xsl:param name="testNgXslt.cssFile"/>
|
16
|
<xsl:param name="testNgXslt.showRuntimeTotals"/>
|
17
|
<xsl:param name="testNgXslt.reportTitle"/>
|
18
|
<xsl:param name="testNgXslt.sortTestCaseLinks"/>
|
19
|
<xsl:param name="testNgXslt.chartScaleFactor"/>
|
20
|
<!-- FAIL,PASS,SKIP,CONF,BY_CLASS-->
|
21
|
<xsl:param name="testNgXslt.testDetailsFilter"/>
|
22
|
|
23
|
<xsl:variable name="testDetailsFilter" select="if ($testNgXslt.testDetailsFilter) then $testNgXslt.testDetailsFilter else 'FAIL,PASS,SKIP'"/>
|
24
|
|
25
|
<xsl:variable name="chartWidth" select="round(600 * testng:getVariableSafe($testNgXslt.chartScaleFactor, 1))"/>
|
26
|
<xsl:variable name="chartHeight" select="round(200 * testng:getVariableSafe($testNgXslt.chartScaleFactor, 1))"/>
|
27
|
|
28
|
<xsl:template name="writeCssFile">
|
29
|
<xsl:result-document href="{testng:absolutePath('style.css')}" format="text">
|
30
|
<xsl:choose>
|
31
|
<xsl:when test="testng:isFilterSelected('CONF') = 'true'">
|
32
|
.testMethodStatusCONF { }
|
33
|
</xsl:when>
|
34
|
<xsl:otherwise>
|
35
|
.testMethodStatusCONF { display: none; }
|
36
|
</xsl:otherwise>
|
37
|
</xsl:choose>
|
38
|
|
39
|
<xsl:choose>
|
40
|
<xsl:when test="testng:isFilterSelected('FAIL') = 'true'">
|
41
|
.testMethodStatusFAIL { background-color: #FFBBBB; }
|
42
|
</xsl:when>
|
43
|
<xsl:otherwise>
|
44
|
.testMethodStatusFAIL { background-color: #FFBBBB; display: none; }
|
45
|
</xsl:otherwise>
|
46
|
</xsl:choose>
|
47
|
|
48
|
<xsl:choose>
|
49
|
<xsl:when test="testng:isFilterSelected('PASS') = 'true'">
|
50
|
.testMethodStatusPASS { background-color: lightgreen; }
|
51
|
</xsl:when>
|
52
|
<xsl:otherwise>
|
53
|
.testMethodStatusPASS { background-color: lightgreen; display: none; }
|
54
|
</xsl:otherwise>
|
55
|
</xsl:choose>
|
56
|
|
57
|
<xsl:choose>
|
58
|
<xsl:when test="testng:isFilterSelected('SKIP') = 'true'">
|
59
|
.testMethodStatusSKIP { background-color: #FFFFBB; }
|
60
|
</xsl:when>
|
61
|
<xsl:otherwise>
|
62
|
.testMethodStatusSKIP { background-color: #FFFFBB; display: none; }
|
63
|
</xsl:otherwise>
|
64
|
</xsl:choose>
|
65
|
|
66
|
<![CDATA[
|
67
|
body { font-family: Arial, sans-serif; font-size: 12px; padding: 10px; margin: 0px; background-color: white; }
|
68
|
a, a:hover, a:active, a:visited { color: navy; }
|
69
|
|
70
|
.suiteMenuHeader { margin-top: 10px; }
|
71
|
.suiteMenuHeader td { padding: 5px; background-color: #e0e0e0; font-size: 12px; width: 100%; vertical-align: top; }
|
72
|
|
73
|
.suiteStatusPass, .suiteStatusFail { padding-right: 20px; width: 20px; height: 20px; margin: 2px 4px 2px 2px; display: inline; }
|
74
|
.suiteStatusPass { background-color: green; }
|
75
|
.suiteStatusFail { background-color: red; }
|
76
|
|
77
|
.testCaseLink, .testCaseLinkSelected { margin-top: 2px; padding: 4px; cursor: pointer; }
|
78
|
.testCaseLink { background-color: #f6f6f6; }
|
79
|
.testCaseLinkSelected { background-color: lightblue; border: 1px solid gray; padding: 3px; }
|
80
|
.testCaseFail, .testCasePass, .testCaseSkip { padding-right: 15px; width: 15px; height: 15px; margin: 2px 4px 2px 2px; display: inline; }
|
81
|
.testCaseFail { background-color: red; }
|
82
|
.testCasePass { background-color: green; }
|
83
|
.testCaseSkip { background-color: yellow; }
|
84
|
|
85
|
tr.methodsTableHeader { background-color: #eaf0f7; font-weight: bold; }
|
86
|
tr.methodsTableHeader td { padding: 3px; }
|
87
|
|
88
|
.testMethodStatusFAIL a, .testMethodStatusPASS a, .testMethodStatusSKIP a { color:navy; text-decoration: none; cursor: pointer; }
|
89
|
.testMethodStatusFAIL td, .testMethodStatusPASS td, .testMethodStatusSKIP td { padding: 3px; }
|
90
|
|
91
|
.testMethodDetails, .testMethodDetailsVisible { padding: 5px; background-color: #f5f5f5; margin: 1px; }
|
92
|
.testMethodDetails { display: none; }
|
93
|
|
94
|
.testMethodsTable { margin-top: 10px; font-size: 12px; }
|
95
|
.testMethodsTable td { border-width: 1px 0 0 1px; border-color: white; border-style:solid; }
|
96
|
.testMethodsTable .detailsBox { padding: 0; background-color: white; border-style: none; height: 0px; }
|
97
|
.testMethodsTable .testMethodStatusCONF td.firstMethodCell { border-left: 5px solid gray; }
|
98
|
]]>
|
99
|
</xsl:result-document>
|
100
|
</xsl:template>
|
101
|
|
102
|
<xsl:template name="writeJsFile">
|
103
|
<xsl:result-document href="{testng:absolutePath('main.js')}" format="text">
|
104
|
<![CDATA[
|
105
|
var selectedTestCaseLink;
|
106
|
|
107
|
function clearAllSelections() {
|
108
|
if (selectedTestCaseLink != null) {
|
109
|
selectedTestCaseLink.className = "testCaseLink";
|
110
|
}
|
111
|
}
|
112
|
|
113
|
function selectTestCaseLink(testCaseLinkElement) {
|
114
|
clearAllSelections();
|
115
|
testCaseLinkElement.className = "testCaseLinkSelected";
|
116
|
selectedTestCaseLink = testCaseLinkElement;
|
117
|
}
|
118
|
|
119
|
function switchTestMethodsView(checkbox) {
|
120
|
document.getElementById("testMethodsByStatus").style["display"] = checkbox.checked ? "none" : "block";
|
121
|
document.getElementById("testMethodsByClass").style["display"] = checkbox.checked ? "block" : "none";
|
122
|
}
|
123
|
|
124
|
function toggleVisibility(elementId) {
|
125
|
var displayElement = document.getElementById(elementId);
|
126
|
if (getCurrentStyle(displayElement, "display") == "none") {
|
127
|
displayElement.style["display"] = "block";
|
128
|
} else {
|
129
|
displayElement.style["display"] = "none";
|
130
|
}
|
131
|
}
|
132
|
|
133
|
function toggleDetailsVisibility(elementId) {
|
134
|
var displayElement = document.getElementById(elementId);
|
135
|
if (displayElement.className == "testMethodDetails") {
|
136
|
displayElement.className = "testMethodDetailsVisible";
|
137
|
} else {
|
138
|
displayElement.className = "testMethodDetails";
|
139
|
}
|
140
|
}
|
141
|
|
142
|
function getCurrentStyle(elem, prop) {
|
143
|
if (elem.currentStyle) {
|
144
|
var ar = prop.match(/\w[^-]*/g);
|
145
|
var s = ar[0];
|
146
|
for(var i = 1; i < ar.length; ++i) {
|
147
|
s += ar[i].replace(/\w/, ar[i].charAt(0).toUpperCase());
|
148
|
}
|
149
|
return elem.currentStyle[s];
|
150
|
} else if (document.defaultView.getComputedStyle) {
|
151
|
return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
|
152
|
}
|
153
|
}
|
154
|
|
155
|
function testMethodsFilterChanged(filterCheckBox, status) {
|
156
|
var filterAll = document.getElementById("methodsFilter_ALL");
|
157
|
var filterFail = document.getElementById("methodsFilter_FAIL");
|
158
|
var filterPass = document.getElementById("methodsFilter_PASS");
|
159
|
var filterSkip = document.getElementById("methodsFilter_SKIP");
|
160
|
var filterConf = document.getElementById("methodsFilter_CONF");
|
161
|
if (filterCheckBox != filterAll) {
|
162
|
filterMethods(filterCheckBox, status);
|
163
|
checkMainFilter(filterAll, filterFail, filterPass, filterSkip, filterConf);
|
164
|
} else {
|
165
|
filterFail.checked = filterPass.checked = filterSkip.checked = filterConf.checked = filterAll.checked;
|
166
|
filterMethods(filterAll, "FAIL");
|
167
|
filterMethods(filterAll, "PASS");
|
168
|
filterMethods(filterAll, "SKIP");
|
169
|
filterMethods(filterAll, "CONF");
|
170
|
}
|
171
|
closeAllExpandedDetails();
|
172
|
}
|
173
|
|
174
|
function checkMainFilter(filterAll, filterFail, filterPass, filterSkip, filterConf) {
|
175
|
if ((filterFail.checked == filterPass.checked) && (filterPass.checked == filterSkip.checked) && (filterSkip.checked == filterConf.checked)) {
|
176
|
filterAll.checked = filterFail.checked;
|
177
|
} else {
|
178
|
filterAll.checked = false;
|
179
|
}
|
180
|
}
|
181
|
|
182
|
function filterMethods(filterCheckBox, status) {
|
183
|
var visible = filterCheckBox.checked;
|
184
|
alterCssElement("testMethodStatus" + status, "display", visible ? "" : "none");
|
185
|
}
|
186
|
|
187
|
function alterCssElement(cssClass, element, value) {
|
188
|
var rules;
|
189
|
if (document.all) {
|
190
|
rules = 'rules';
|
191
|
}
|
192
|
else if (document.getElementById) {
|
193
|
rules = 'cssRules';
|
194
|
}
|
195
|
for (var i = 0; i < document.styleSheets.length; i++) {
|
196
|
for (var j = 0; j < document.styleSheets[i][rules].length; j++) {
|
197
|
if (document.styleSheets[i][rules][j].selectorText.indexOf(cssClass) > -1) {
|
198
|
document.styleSheets[i][rules][j].style[element] = value;
|
199
|
break;
|
200
|
}
|
201
|
}
|
202
|
}
|
203
|
}
|
204
|
|
205
|
function closeAllExpandedDetails() {
|
206
|
var node = document.getElementsByTagName("body")[0];
|
207
|
//var re = new RegExp("\\btestMethodDetailsVisible\\b");
|
208
|
var els = document.getElementsByTagName("div");
|
209
|
for (var i = 0,j = els.length; i < j; i++) {
|
210
|
if (els[i].className == "testMethodDetailsVisible") {
|
211
|
els[i].className = "testMethodDetails";
|
212
|
}
|
213
|
}
|
214
|
}
|
215
|
|
216
|
function renderSvgEmbedTag(chartWidth, chartHeight) {
|
217
|
var success = false;
|
218
|
var userAgent = navigator.userAgent;
|
219
|
|
220
|
if (userAgent.indexOf("Firefox") > -1 || userAgent.indexOf("Safari") > -1) {
|
221
|
success = true;
|
222
|
} else if (navigator.mimeTypes != null && navigator.mimeTypes.length > 0) {
|
223
|
if (navigator.mimeTypes["image/svg+xml"] != null) {
|
224
|
success = true;
|
225
|
}
|
226
|
} else if (window.ActiveXObject) {
|
227
|
try {
|
228
|
testObj = new ActiveXObject("Adobe.SVGCtl");
|
229
|
success = true;
|
230
|
} catch (e) {}
|
231
|
}
|
232
|
|
233
|
var chartContainer = document.getElementById('chart-container');
|
234
|
|
235
|
if (success) {
|
236
|
var chart = document.createElement('embed');
|
237
|
|
238
|
chart.src = 'overview-chart.svg';
|
239
|
chart.type = 'image/svg+xml';
|
240
|
chart.width = chartWidth;
|
241
|
chart.height = chartHeight;
|
242
|
|
243
|
chartContainer.appendChild(chart);
|
244
|
} else {
|
245
|
var message = document.createElement('h4');
|
246
|
var text = document.createTextNode('SVG Pie Charts are not available. Please install a SVG viewer for your browser.');
|
247
|
|
248
|
message.style.color = 'navy';
|
249
|
message.appendChild(text);
|
250
|
|
251
|
chartContainer.appendChild(message);
|
252
|
}
|
253
|
}
|
254
|
]]>
|
255
|
</xsl:result-document>
|
256
|
</xsl:template>
|
257
|
|
258
|
<xsl:template name="htmlHead">
|
259
|
<head>
|
260
|
<title>
|
261
|
<xsl:value-of select="testng:getVariableSafe($testNgXslt.reportTitle, 'TestNG Results')"/>
|
262
|
</title>
|
263
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
264
|
<meta http-equiv="pragma" content="no-cache"/>
|
265
|
<meta http-equiv="cache-control" content="max-age=0"/>
|
266
|
<meta http-equiv="cache-control" content="no-cache"/>
|
267
|
<meta http-equiv="cache-control" content="no-store"/>
|
268
|
<LINK rel="stylesheet" href="style.css"/>
|
269
|
<xsl:if test="$testNgXslt.cssFile">
|
270
|
<LINK rel="stylesheet" href="{$testNgXslt.cssFile}"/>
|
271
|
</xsl:if>
|
272
|
<script type="text/javascript" src="main.js"/>
|
273
|
</head>
|
274
|
</xsl:template>
|
275
|
|
276
|
<xsl:function name="testng:getVariableSafe">
|
277
|
<xsl:param name="testVar"/>
|
278
|
<xsl:param name="defaultValue"/>
|
279
|
<xsl:value-of select="if ($testVar) then $testVar else $defaultValue"/>
|
280
|
</xsl:function>
|
281
|
|
282
|
<xsl:function name="testng:trim">
|
283
|
<xsl:param name="arg"/>
|
284
|
<xsl:sequence select="replace(replace($arg,'\s+$',''),'^\s+','')"/>
|
285
|
</xsl:function>
|
286
|
|
287
|
<xsl:function name="testng:absolutePath">
|
288
|
<xsl:param name="fileName"/>
|
289
|
<xsl:value-of select="concat('file:////', $testNgXslt.outputDir, '/', $fileName)"/>
|
290
|
</xsl:function>
|
291
|
|
292
|
<xsl:function name="testng:safeFileName">
|
293
|
<xsl:param name="fileName"/>
|
294
|
<xsl:value-of select="translate($fileName, '[]{}`~!@#$%^*(){};?/\|' , '______________________')"/>
|
295
|
</xsl:function>
|
296
|
|
297
|
<xsl:function name="testng:suiteContentFileName">
|
298
|
<xsl:param name="suiteElement"/>
|
299
|
<xsl:value-of select="testng:safeFileName(concat($suiteElement/@name, '.html'))"/>
|
300
|
</xsl:function>
|
301
|
|
302
|
<xsl:function name="testng:suiteGroupsFileName">
|
303
|
<xsl:param name="suiteElement"/>
|
304
|
<xsl:value-of select="testng:safeFileName(concat($suiteElement/@name, '_groups.html'))"/>
|
305
|
</xsl:function>
|
306
|
|
307
|
<xsl:function name="testng:testCaseContentFileName">
|
308
|
<xsl:param name="testCaseElement"/>
|
309
|
<xsl:value-of
|
310
|
select="testng:safeFileName(concat($testCaseElement/../@name, '_', $testCaseElement/@name, '.html'))"/>
|
311
|
</xsl:function>
|
312
|
|
313
|
<xsl:function name="testng:concatParams">
|
314
|
<xsl:param name="params"/>
|
315
|
<xsl:variable name="outputString">
|
316
|
<xsl:value-of separator="," select="for $i in ($params) return $i"/>
|
317
|
</xsl:variable>
|
318
|
<xsl:value-of select="$outputString"/>
|
319
|
</xsl:function>
|
320
|
|
321
|
<xsl:function name="testng:testMethodStatus">
|
322
|
<xsl:param name="testMethodElement"/>
|
323
|
<xsl:variable name="status" select="$testMethodElement/@status"/>
|
324
|
<xsl:variable name="statusClass" select="concat('testMethodStatus', $status)"/>
|
325
|
<xsl:value-of select="if ($testMethodElement/@is-config) then concat($statusClass, ' testMethodStatusCONF') else $statusClass"/>
|
326
|
</xsl:function>
|
327
|
|
328
|
<xsl:function name="testng:suiteMethodsCount">
|
329
|
<xsl:param name="testCasesElements"/>
|
330
|
<xsl:param name="state"/>
|
331
|
<xsl:value-of
|
332
|
select="if ($state = '*') then count($testCasesElements/class/test-method[not(@is-config)]) else count($testCasesElements/class/test-method[(@status=$state) and (not(@is-config))])"/>
|
333
|
</xsl:function>
|
334
|
|
335
|
<xsl:function name="testng:testCaseMethodsCount">
|
336
|
<xsl:param name="testCaseElement"/>
|
337
|
<xsl:param name="state"/>
|
338
|
<xsl:value-of
|
339
|
select="if ($state = '*') then count($testCaseElement/class/test-method[not(@is-config)]) else count($testCaseElement/class/test-method[(@status=$state) and (not(@is-config))])"/>
|
340
|
</xsl:function>
|
341
|
|
342
|
<xsl:function name="testng:suiteStateClass">
|
343
|
<xsl:param name="testCaseElements"/>
|
344
|
<xsl:value-of select="if (count($testCaseElements/class/test-method[(@status='FAIL') and (not(@is-config))]) > 0) then 'suiteStatusFail' else 'suiteStatusPass'"/>
|
345
|
</xsl:function>
|
346
|
|
347
|
<xsl:function name="testng:formatDuration">
|
348
|
<xsl:param name="durationMs"/>
|
349
|
<!--Days-->
|
350
|
<xsl:if test="$durationMs > 86400000">
|
351
|
<xsl:value-of select="format-number($durationMs div 86400000, '#')"/>d
|
352
|
</xsl:if>
|
353
|
<!--Hours-->
|
354
|
<xsl:if test="($durationMs > 3600000) and ($durationMs mod 86400000 > 1000)">
|
355
|
<xsl:value-of select="format-number(($durationMs mod 86400000) div 3600000, '#')"/>h
|
356
|
</xsl:if>
|
357
|
<xsl:if test="$durationMs < 86400000">
|
358
|
<!--Minutes-->
|
359
|
<xsl:if test="($durationMs > 60000) and ($durationMs mod 3600000 > 1000)">
|
360
|
<xsl:value-of select="format-number(($durationMs mod 3600000) div 60000, '#')"/>m
|
361
|
</xsl:if>
|
362
|
<!--Seconds-->
|
363
|
<xsl:if test="($durationMs > 1000) and ($durationMs mod 60000 > 1000)">
|
364
|
<xsl:value-of select="format-number(($durationMs mod 60000) div 1000, '#')"/>s
|
365
|
</xsl:if>
|
366
|
</xsl:if>
|
367
|
<!--Milliseconds - only when less than a second-->
|
368
|
<xsl:if test="$durationMs < 1000">
|
369
|
<xsl:value-of select="$durationMs"/> ms
|
370
|
</xsl:if>
|
371
|
</xsl:function>
|
372
|
|
373
|
<xsl:function name="testng:isFilterSelected">
|
374
|
<xsl:param name="filterName"/>
|
375
|
<xsl:value-of select="contains($testDetailsFilter, $filterName)"/>
|
376
|
</xsl:function>
|
377
|
|
378
|
<xsl:template name="formField">
|
379
|
<xsl:param name="label"/>
|
380
|
<xsl:param name="value"/>
|
381
|
<xsl:if test="$value">
|
382
|
<div>
|
383
|
<b>
|
384
|
<xsl:value-of select="$label"/>
|
385
|
<xsl:text>: </xsl:text>
|
386
|
</b>
|
387
|
<xsl:value-of select="$value"/>
|
388
|
</div>
|
389
|
</xsl:if>
|
390
|
</xsl:template>
|
391
|
|
392
|
<xsl:template name="formFieldList">
|
393
|
<xsl:param name="label"/>
|
394
|
<xsl:param name="value"/>
|
395
|
<xsl:if test="count($value) > 0">
|
396
|
<div>
|
397
|
<b>
|
398
|
<xsl:value-of select="$label"/>:
|
399
|
</b>
|
400
|
<xsl:for-each select="$value">
|
401
|
<div>
|
402
|
    -
|
403
|
<xsl:value-of select="."/>
|
404
|
</div>
|
405
|
</xsl:for-each>
|
406
|
</div>
|
407
|
</xsl:if>
|
408
|
</xsl:template>
|
409
|
|
410
|
<xsl:template match="/testng-results">
|
411
|
<xsl:call-template name="writeCssFile"/>
|
412
|
<xsl:call-template name="writeJsFile"/>
|
413
|
<html>
|
414
|
<xsl:call-template name="htmlHead"/>
|
415
|
<frameset cols="250px, 100%" frameborder="1">
|
416
|
<frame name="navigation" src="navigation.html"/>
|
417
|
<frame name="content" src="overview.html"/>
|
418
|
</frameset>
|
419
|
</html>
|
420
|
|
421
|
<xsl:variable name="suiteElements" select="if (suite/@url) then document(suite/@url)/suite else suite"/>
|
422
|
|
423
|
<xsl:call-template name="navigationFile">
|
424
|
<xsl:with-param name="suiteElements" select="$suiteElements"/>
|
425
|
<xsl:with-param name="reporterOutputElement" select="reporter-output"/>
|
426
|
</xsl:call-template>
|
427
|
|
428
|
<!--TODO: Review this-->
|
429
|
<xsl:result-document href="{testng:absolutePath('overview-chart.svg')}" format="xml">
|
430
|
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet" width="{$chartWidth}" height="{$chartHeight}"
|
431
|
viewBox="0 0 900 300">
|
432
|
<defs>
|
433
|
<style type="text/css">
|
434
|
<![CDATA[
|
435
|
.axistitle { font-weight:bold; font-size:24px; font-family:Arial; text-anchor:middle; }
|
436
|
.xgrid, .ygrid, .legendtext { font-weight:normal; font-size:24px; font-family:Arial; }
|
437
|
.xgrid {text-anchor:middle;}
|
438
|
.ygrid {text-anchor:end;}
|
439
|
.gridline { stroke:black; stroke-width:1; }
|
440
|
.values { fill:black; stroke:none; text-anchor:middle; font-size:12px; font-weight:bold; }
|
441
|
]]>
|
442
|
</style>
|
443
|
</defs>
|
444
|
<svg id="graphzone" preserveAspectRatio="xMidYMid meet" x="0" y="0">
|
445
|
<xsl:variable name="testCaseElements" select="
|
446
|
if (suite/@url) then
|
447
|
if (document(suite/@url)/suite/test/@url)
|
448
|
then document(document(suite/@url)/suite/test/@url)/test
|
449
|
else document(suite/@url)/suite/test
|
450
|
else suite/test"/>
|
451
|
<xsl:variable name="failedCount" select="testng:suiteMethodsCount($testCaseElements, 'FAIL')"/>
|
452
|
<xsl:variable name="passedCount" select="testng:suiteMethodsCount($testCaseElements, 'PASS')"/>
|
453
|
<xsl:variable name="skippedCount" select="testng:suiteMethodsCount($testCaseElements, 'SKIP')"/>
|
454
|
<xsl:variable name="totalCount" select="testng:suiteMethodsCount($testCaseElements, '*')"/>
|
455
|
|
456
|
<xsl:variable name="pi" select="3.141592"/>
|
457
|
<xsl:variable name="radius" select="130"/>
|
458
|
|
459
|
<xsl:variable name="failedPercent" select="format-number($failedCount div $totalCount, '###%')"/>
|
460
|
<xsl:variable name="failedAngle" select="($failedCount div $totalCount) * $pi * 2"/>
|
461
|
<xsl:variable name="failedX" select="$radius * math:cos($failedAngle)"/>
|
462
|
<xsl:variable name="failedY" select="-1 * $radius * math:sin($failedAngle)"/>
|
463
|
<xsl:variable name="failedArc" select="if ($failedAngle >= $pi) then 1 else 0"/>
|
464
|
|
465
|
<xsl:variable name="failedAngle_text" select="$failedAngle div 2"/>
|
466
|
<xsl:variable name="failedX_text" select="($radius div 2) * math:cos($failedAngle_text)"/>
|
467
|
<xsl:variable name="failedY_text" select="(-1 * ($radius div 2) * math:sin($failedAngle_text))"/>
|
468
|
|
469
|
<xsl:variable name="passPercent" select="format-number($passedCount div $totalCount, '###%')"/>
|
470
|
<xsl:variable name="passAngle" select="($passedCount div $totalCount) * $pi * 2"/>
|
471
|
<xsl:variable name="passX" select="$radius * math:cos($passAngle)"/>
|
472
|
<xsl:variable name="passY" select="-1 * $radius * math:sin($passAngle)"/>
|
473
|
<xsl:variable name="passArc" select="if ($passAngle >= $pi) then 1 else 0"/>
|
474
|
|
475
|
<xsl:variable name="skipPercent" select="format-number($skippedCount div $totalCount, '###%')"/>
|
476
|
<xsl:variable name="skipAngle" select="($skippedCount div $totalCount) * $pi * 2"/>
|
477
|
<xsl:variable name="skipX" select="$radius * math:cos($skipAngle)"/>
|
478
|
<xsl:variable name="skipY" select="-1 * $radius * math:sin($skipAngle)"/>
|
479
|
<xsl:variable name="skipArc" select="if ($skipAngle >= $pi) then 1 else 0"/>
|
480
|
|
481
|
<rect style="fill:red;stroke-width:1;stroke:black;" x="10" y="86" width="20" height="20"/>
|
482
|
<text class="legendtext" x="40" y="105">Failed (<xsl:value-of select="$failedPercent"/>)
|
483
|
</text>
|
484
|
<rect style="fill:green;stroke-width:1;stroke:black;" x="10" y="125" width="20" height="20"/>
|
485
|
<text class="legendtext" x="40" y="143">Passed (<xsl:value-of select="$passPercent"/>)
|
486
|
</text>
|
487
|
<rect style="fill:yellow;stroke-width:1;stroke:black;" x="10" y="163" width="20" height="20"/>
|
488
|
<text class="legendtext" x="40" y="182">Skipped (<xsl:value-of select="$skipPercent"/>)
|
489
|
</text>
|
490
|
<g style="stroke:black;stroke-width:1" transform="translate(450,150)">
|
491
|
<xsl:variable name="failedRotation" select="(($skippedCount) div $totalCount) * 360"/>
|
492
|
<xsl:if test="($failedCount div $totalCount) > 0">
|
493
|
<g style="fill:red"
|
494
|
transform="rotate(-{$failedRotation}) translate({round($failedX_text div 4)}, {round($failedY_text div 4)})">
|
495
|
<path d="M 0 0 h {$radius} A {$radius},{$radius} 0,{$failedArc},0 {$failedX},{$failedY} z"/>
|
496
|
</g>
|
497
|
</xsl:if>
|
498
|
<xsl:variable name="passRotation" select="(($failedCount + $skippedCount) div $totalCount) * 360"/>
|
499
|
<xsl:if test="($passedCount div $totalCount) > 0">
|
500
|
<g style="fill:green" transform="rotate(-{$passRotation})">
|
501
|
<path d="M 0 0 h {$radius} A {$radius},{$radius} 0,{$passArc},0 {$passX},{$passY} z"/>
|
502
|
</g>
|
503
|
</xsl:if>
|
504
|
<xsl:if test="($skippedCount div $totalCount) > 0">
|
505
|
<g style="fill:yellow" transform="rotate(360)">
|
506
|
<path d="M 0 0 h {$radius} A {$radius},{$radius} 0,{$skipArc},0 {$skipX},{$skipY} z"/>
|
507
|
</g>
|
508
|
</xsl:if>
|
509
|
</g>
|
510
|
</svg>
|
511
|
</svg>
|
512
|
</xsl:result-document>
|
513
|
|
514
|
|
515
|
<!-- Results overview file -->
|
516
|
<xsl:result-document href="{testng:absolutePath('overview.html')}" format="xhtml">
|
517
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
518
|
<xsl:call-template name="htmlHead"/>
|
519
|
<body>
|
520
|
<h2>Test suites overview</h2>
|
521
|
<table width="100%">
|
522
|
<tr>
|
523
|
<td align="center" id="chart-container">
|
524
|
<script type="text/javascript">
|
525
|
renderSvgEmbedTag(<xsl:value-of select="$chartWidth"/>, <xsl:value-of select="$chartHeight"/>);
|
526
|
</script>
|
527
|
</td>
|
528
|
</tr>
|
529
|
</table>
|
530
|
<xsl:for-each select="$suiteElements">
|
531
|
<xsl:variable name="testCaseElements"
|
532
|
select="if (test/@url) then document(test/@url)/test else test"/>
|
533
|
<table width="100%" cellpadding="5" cellspacing="1">
|
534
|
<tr style="background-color: #eaf0f7;">
|
535
|
<td width="100%">
|
536
|
<div class="{testng:suiteStateClass($testCaseElements)}"/>
|
537
|
<xsl:value-of select="@name"/>
|
538
|
</td>
|
539
|
<xsl:call-template name="percentageOverview">
|
540
|
<xsl:with-param name="failedCount"
|
541
|
select="testng:suiteMethodsCount($testCaseElements, 'FAIL')"/>
|
542
|
<xsl:with-param name="passedCount"
|
543
|
select="testng:suiteMethodsCount($testCaseElements, 'PASS')"/>
|
544
|
<xsl:with-param name="skippedCount"
|
545
|
select="testng:suiteMethodsCount($testCaseElements, 'SKIP')"/>
|
546
|
<xsl:with-param name="totalCount"
|
547
|
select="testng:suiteMethodsCount($testCaseElements, '*')"/>
|
548
|
<xsl:with-param name="totalDuration"
|
549
|
select="testng:formatDuration(./@duration-ms)"/>
|
550
|
</xsl:call-template>
|
551
|
</tr>
|
552
|
<xsl:for-each select="$testCaseElements">
|
553
|
<tr style="background-color: #f5f5f5; font-size: 12px;">
|
554
|
<td>
|
555
|
<xsl:value-of select="@name"/>
|
556
|
</td>
|
557
|
<td align="center">
|
558
|
<xsl:value-of select="testng:testCaseMethodsCount(., 'FAIL')"/>
|
559
|
</td>
|
560
|
<td align="center">
|
561
|
<xsl:value-of select="testng:testCaseMethodsCount(., 'PASS')"/>
|
562
|
</td>
|
563
|
<td align="center">
|
564
|
<xsl:value-of select="testng:testCaseMethodsCount(., 'SKIP')"/>
|
565
|
</td>
|
566
|
<td align="center">
|
567
|
<xsl:value-of select="testng:testCaseMethodsCount(., '*')"/>
|
568
|
</td>
|
569
|
<td align="center" style="font-weight: bold;">
|
570
|
<xsl:value-of
|
571
|
select="if (testng:testCaseMethodsCount(., '*') > 0) then format-number(testng:testCaseMethodsCount(., 'PASS') div testng:testCaseMethodsCount(., '*'), '###%') else '100%'"/>
|
572
|
</td>
|
573
|
<xsl:if test="compare($testNgXslt.showRuntimeTotals, 'true') = 0">
|
574
|
<td align="center" nowrap="true">
|
575
|
<xsl:value-of select="testng:formatDuration(./@duration-ms)"/>
|
576
|
</td>
|
577
|
</xsl:if>
|
578
|
</tr>
|
579
|
</xsl:for-each>
|
580
|
</table>
|
581
|
<br/>
|
582
|
</xsl:for-each>
|
583
|
<xsl:call-template name="powered-by"/>
|
584
|
</body>
|
585
|
</html>
|
586
|
</xsl:result-document>
|
587
|
|
588
|
<!-- Reporter output file -->
|
589
|
<xsl:result-document href="{testng:absolutePath('reporterOutput.html')}" format="xhtml">
|
590
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
591
|
<xsl:call-template name="htmlHead"/>
|
592
|
<body>
|
593
|
<h2>Reporter output</h2>
|
594
|
<xsl:for-each select="reporter-output/line">
|
595
|
<div>
|
596
|
<code>
|
597
|
<xsl:value-of select="."/>
|
598
|
</code>
|
599
|
</div>
|
600
|
</xsl:for-each>
|
601
|
<xsl:call-template name="powered-by"/>
|
602
|
</body>
|
603
|
</html>
|
604
|
</xsl:result-document>
|
605
|
</xsl:template>
|
606
|
|
607
|
<xsl:template name="navigationFile">
|
608
|
<xsl:param name="suiteElements"/>
|
609
|
<xsl:param name="reporterOutputElement"/>
|
610
|
<xsl:result-document href="{testng:absolutePath('navigation.html')}" format="xhtml">
|
611
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
612
|
<xsl:call-template name="htmlHead"/>
|
613
|
<body>
|
614
|
<h2 style="margin-bottom: 5px;">
|
615
|
<xsl:value-of select="testng:getVariableSafe($testNgXslt.reportTitle, 'TestNG Results')"/>
|
616
|
</h2>
|
617
|
<div>
|
618
|
<a href="overview.html" target="content"
|
619
|
onclick="javscript:clearAllSelections();">Results overview
|
620
|
</a>
|
621
|
</div>
|
622
|
<div>
|
623
|
<a href="reporterOutput.html" target="content"
|
624
|
onclick="javscript:clearAllSelections();">Reporter output
|
625
|
</a>
|
626
|
</div>
|
627
|
<div>
|
628
|
<xsl:for-each select="$suiteElements">
|
629
|
<xsl:variable name="testCaseElements"
|
630
|
select="if (test/@url) then document(test/@url)/test else test"/>
|
631
|
<table class="suiteMenuHeader" width="100%" cellpadding="0" cellspacing="0">
|
632
|
<tr>
|
633
|
<td nowrap="true">
|
634
|
<b>
|
635
|
<a href="{testng:suiteContentFileName(.)}" target="content"
|
636
|
onclick="javscript:clearAllSelections();">
|
637
|
<xsl:value-of select="@name"/>
|
638
|
</a>
|
639
|
</b>
|
640
|
<div style="margin: 3px 0 3px 0;">
|
641
|
<a href="{testng:suiteGroupsFileName(.)}" target="content"
|
642
|
onclick="javscript:clearAllSelections();">
|
643
|
<xsl:value-of select="count(./groups/group)"/>
|
644
|
Groups
|
645
|
</a>
|
646
|
</div>
|
647
|
<span style="color: red;">
|
648
|
<xsl:value-of select="testng:suiteMethodsCount($testCaseElements, 'FAIL')"/>
|
649
|
</span>
|
650
|
/
|
651
|
<span style="color: green;">
|
652
|
<xsl:value-of select="testng:suiteMethodsCount($testCaseElements, 'PASS')"/>
|
653
|
</span>
|
654
|
/
|
655
|
<span style="color: yellow;">
|
656
|
<xsl:value-of select="testng:suiteMethodsCount($testCaseElements, 'SKIP')"/>
|
657
|
</span>
|
658
|
/
|
659
|
<span>
|
660
|
<xsl:value-of select="testng:suiteMethodsCount($testCaseElements, '*')"/>
|
661
|
</span>
|
662
|
</td>
|
663
|
<td style="font-weight: bold;">
|
664
|
<xsl:value-of
|
665
|
select="format-number(testng:suiteMethodsCount($testCaseElements, 'PASS') div testng:suiteMethodsCount($testCaseElements, '*'), '###%')"/>
|
666
|
</td>
|
667
|
</tr>
|
668
|
</table>
|
669
|
<xsl:call-template name="suiteContentFile">
|
670
|
<xsl:with-param name="suiteElement" select="."/>
|
671
|
</xsl:call-template>
|
672
|
<xsl:call-template name="suiteGroupsFile">
|
673
|
<xsl:with-param name="suiteElement" select="."/>
|
674
|
</xsl:call-template>
|
675
|
<xsl:call-template name="suiteTestCasesLinks">
|
676
|
<xsl:with-param name="testCases" select="$testCaseElements"/>
|
677
|
</xsl:call-template>
|
678
|
<xsl:call-template name="suiteTestCasesContentFiles">
|
679
|
<xsl:with-param name="testCases" select="$testCaseElements"/>
|
680
|
</xsl:call-template>
|
681
|
</xsl:for-each>
|
682
|
</div>
|
683
|
</body>
|
684
|
</html>
|
685
|
</xsl:result-document>
|
686
|
</xsl:template>
|
687
|
|
688
|
<xsl:template name="suiteContentFile">
|
689
|
<xsl:param name="suiteElement"/>
|
690
|
<xsl:variable name="testCaseElements" select="if (test/@url) then document(test/@url)/test else test"/>
|
691
|
<xsl:result-document href="{testng:absolutePath(testng:suiteContentFileName($suiteElement))}" format="xhtml">
|
692
|
<html>
|
693
|
<xsl:call-template name="htmlHead"/>
|
694
|
<body>
|
695
|
<table width="100%" style="font-size: 16px; margin-bottom: 10px;" cellspacing="1">
|
696
|
<tr>
|
697
|
<td width="100%">
|
698
|
All methods in suite
|
699
|
<b>
|
700
|
<xsl:value-of select="./@name"/>
|
701
|
</b>
|
702
|
</td>
|
703
|
<xsl:call-template name="percentageOverview">
|
704
|
<xsl:with-param name="failedCount"
|
705
|
select="testng:suiteMethodsCount($testCaseElements, 'FAIL')"/>
|
706
|
<xsl:with-param name="passedCount"
|
707
|
select="testng:suiteMethodsCount($testCaseElements, 'PASS')"/>
|
708
|
<xsl:with-param name="skippedCount"
|
709
|
select="testng:suiteMethodsCount($testCaseElements, 'SKIP')"/>
|
710
|
<xsl:with-param name="totalCount"
|
711
|
select="testng:suiteMethodsCount($testCaseElements, '*')"/>
|
712
|
<xsl:with-param name="totalDuration"
|
713
|
select="testng:formatDuration($suiteElement/@duration-ms)"/>
|
714
|
</xsl:call-template>
|
715
|
</tr>
|
716
|
</table>
|
717
|
<xsl:call-template name="testMethods">
|
718
|
<xsl:with-param name="classes" select="$testCaseElements/class"/>
|
719
|
<xsl:with-param name="failedMethods" select="$testCaseElements/class/test-method[@status='FAIL']"/>
|
720
|
<xsl:with-param name="passedMethods" select="$testCaseElements/class/test-method[@status='PASS']"/>
|
721
|
<xsl:with-param name="skipedMethods" select="$testCaseElements/class/test-method[@status='SKIP']"/>
|
722
|
</xsl:call-template>
|
723
|
<xsl:call-template name="powered-by"/>
|
724
|
</body>
|
725
|
</html>
|
726
|
</xsl:result-document>
|
727
|
</xsl:template>
|
728
|
|
729
|
<xsl:template name="suiteGroupsFile">
|
730
|
<xsl:param name="suiteElement"/>
|
731
|
<xsl:result-document href="{testng:absolutePath(testng:suiteGroupsFileName($suiteElement))}" format="xhtml">
|
732
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
733
|
<xsl:call-template name="htmlHead"/>
|
734
|
<body>
|
735
|
<h2>
|
736
|
Groups for suite:
|
737
|
<b>
|
738
|
<xsl:value-of select="$suiteElement/@name"/>
|
739
|
</b>
|
740
|
</h2>
|
741
|
<xsl:for-each select="$suiteElement/groups/group">
|
742
|
<xsl:sort order="ascending" select="@name"/>
|
743
|
<table style="margin-bottom: 20px; font-size: 12px; width:100%;" cellpadding="3"
|
744
|
cellspacing="1">
|
745
|
<tr>
|
746
|
<td style="background-color: #f5f5f5;">
|
747
|
<div style="font-size: 18px;">
|
748
|
<xsl:value-of select="./@name"/>
|
749
|
</div>
|
750
|
</td>
|
751
|
</tr>
|
752
|
<xsl:for-each select="method">
|
753
|
<tr>
|
754
|
<td style="background-color: #eaf0f7;">
|
755
|
<xsl:value-of select="@signature"/>
|
756
|
</td>
|
757
|
</tr>
|
758
|
</xsl:for-each>
|
759
|
</table>
|
760
|
</xsl:for-each>
|
761
|
<xsl:call-template name="powered-by"/>
|
762
|
</body>
|
763
|
</html>
|
764
|
</xsl:result-document>
|
765
|
</xsl:template>
|
766
|
|
767
|
<xsl:template name="testMethods">
|
768
|
<xsl:param name="classes"/>
|
769
|
<xsl:param name="failedMethods"/>
|
770
|
<xsl:param name="passedMethods"/>
|
771
|
<xsl:param name="skipedMethods"/>
|
772
|
<xsl:param name="filePrefix"/>
|
773
|
|
774
|
<div style="width: 200px;">
|
775
|
<label for="groupMethodsCheckBox" style="font-weight: bold; margin: 0;">
|
776
|
<input id="groupMethodsCheckBox" type="checkbox" onclick="switchTestMethodsView(this)">
|
777
|
<xsl:if test="testng:isFilterSelected('BY_CLASS') = 'true'">
|
778
|
<xsl:attribute name="checked" select="true"/>
|
779
|
</xsl:if>
|
780
|
</input>
|
781
|
Group by class
|
782
|
</label>
|
783
|
<br/>
|
784
|
<label for="methodsFilter_ALL" style="font-weight: bold; margin: 0;">
|
785
|
<input id="methodsFilter_ALL" type="checkbox" onclick="testMethodsFilterChanged(this, 'ALL')">
|
786
|
<xsl:if test="testng:isFilterSelected('FAIL') = 'true' and testng:isFilterSelected('PASS') = 'true' and testng:isFilterSelected('SKIP') = 'true' and testng:isFilterSelected('CONF') = 'true'">
|
787
|
<xsl:attribute name="checked" select="true"/>
|
788
|
</xsl:if>
|
789
|
</input>
|
790
|
All
|
791
|
</label>
|
792
|
</div>
|
793
|
<label for="methodsFilter_FAIL" style="margin-left: 20px;">
|
794
|
<input id="methodsFilter_FAIL" type="checkbox" onclick="testMethodsFilterChanged(this, 'FAIL')">
|
795
|
<xsl:if test="testng:isFilterSelected('FAIL') = 'true'">
|
796
|
<xsl:attribute name="checked" select="true"/>
|
797
|
</xsl:if>
|
798
|
</input>
|
799
|
Failed
|
800
|
</label>
|
801
|
<label for="methodsFilter_PASS">
|
802
|
<input id="methodsFilter_PASS" type="checkbox" onclick="testMethodsFilterChanged(this, 'PASS')">
|
803
|
<xsl:if test="testng:isFilterSelected('PASS') = 'true'">
|
804
|
<xsl:attribute name="checked" select="true"/>
|
805
|
</xsl:if>
|
806
|
</input>
|
807
|
Passed
|
808
|
</label>
|
809
|
<label for="methodsFilter_SKIP">
|
810
|
<input id="methodsFilter_SKIP" type="checkbox" onclick="testMethodsFilterChanged(this, 'SKIP')">
|
811
|
<xsl:if test="testng:isFilterSelected('SKIP') = 'true'">
|
812
|
<xsl:attribute name="checked" select="true"/>
|
813
|
</xsl:if>
|
814
|
</input>
|
815
|
Skipped
|
816
|
</label>
|
817
|
<label for="methodsFilter_CONF">
|
818
|
<input id="methodsFilter_CONF" type="checkbox" onclick="testMethodsFilterChanged(this, 'CONF')">
|
819
|
<xsl:if test="testng:isFilterSelected('CONF') = 'true'">
|
820
|
<xsl:attribute name="checked" select="true"/>
|
821
|
</xsl:if>
|
822
|
</input>
|
823
|
Config
|
824
|
</label>
|
825
|
<br/>
|
826
|
|
827
|
<!-- Display methods list grouped by status -->
|
828
|
<div id="testMethodsByStatus">
|
829
|
<xsl:if test="testng:isFilterSelected('BY_CLASS') = 'true'">
|
830
|
<xsl:attribute name="style" select="'display: none;'"/>
|
831
|
</xsl:if>
|
832
|
<table class="testMethodsTable" cellpadding="0" cellspacing="0">
|
833
|
<tr class="methodsTableHeader">
|
834
|
<td width="100%">Name</td>
|
835
|
<td nowrap="true">Started</td>
|
836
|
<td nowrap="true">Duration</td>
|
837
|
<td>Exception</td>
|
838
|
</tr>
|
839
|
<xsl:call-template name="testMethodsList">
|
840
|
<xsl:with-param name="methodList" select="$failedMethods"/>
|
841
|
<xsl:with-param name="category" select="'byStatus_failed'"/>
|
842
|
</xsl:call-template>
|
843
|
<xsl:call-template name="testMethodsList">
|
844
|
<xsl:with-param name="methodList" select="$passedMethods"/>
|
845
|
<xsl:with-param name="category" select="'byStatus_passed'"/>
|
846
|
</xsl:call-template>
|
847
|
<xsl:call-template name="testMethodsList">
|
848
|
<xsl:with-param name="methodList" select="$skipedMethods"/>
|
849
|
<xsl:with-param name="category" select="'byStatus_skiped'"/>
|
850
|
</xsl:call-template>
|
851
|
</table>
|
852
|
</div>
|
853
|
|
854
|
<!-- Display methods list grouped by class -->
|
855
|
<div id="testMethodsByClass">
|
856
|
<xsl:if test="testng:isFilterSelected('BY_CLASS') != 'true'">
|
857
|
<xsl:attribute name="style" select="'display: none;'"/>
|
858
|
</xsl:if>
|
859
|
<xsl:for-each select="$classes">
|
860
|
<xsl:sort order="ascending" select="@name"/>
|
861
|
<table class="testMethodsTable" cellpadding="0" cellspacing="0">
|
862
|
<tr>
|
863
|
<td colspan="4">
|
864
|
<h3 style="display: inline;">
|
865
|
<xsl:value-of select="./@name"/>
|
866
|
</h3>
|
867
|
</td>
|
868
|
</tr>
|
869
|
<tr class="methodsTableHeader">
|
870
|
<td width="100%">Name</td>
|
871
|
<td nowrap="true">Started</td>
|
872
|
<td nowrap="true">Duration</td>
|
873
|
<td>Exception</td>
|
874
|
</tr>
|
875
|
<xsl:call-template name="testMethodsList">
|
876
|
<!--<xsl:with-param name="methodList" select="./test-method[not(@is-config)]"/>-->
|
877
|
<xsl:with-param name="methodList" select="./test-method"/>
|
878
|
<xsl:with-param name="category" select="'byClass'"/>
|
879
|
<xsl:with-param name="sortByStartTime" select="'true'"/>
|
880
|
</xsl:call-template>
|
881
|
</table>
|
882
|
<br/>
|
883
|
</xsl:for-each>
|
884
|
</div>
|
885
|
</xsl:template>
|
886
|
|
887
|
<xsl:template name="testMethodsList">
|
888
|
<xsl:param name="methodList"/>
|
889
|
<xsl:param name="category"/>
|
890
|
<xsl:param name="sortByStartTime"/>
|
891
|
<xsl:for-each select="$methodList">
|
892
|
<xsl:sort order="ascending" select="if (compare($sortByStartTime, 'true') = 0) then @started-at else ''"/>
|
893
|
<xsl:variable name="methodId" select="concat(../@name, '_', @name, '_', $category, '_', @status, position())"/>
|
894
|
<xsl:variable name="detailsId" select="concat($methodId, '_details')"/>
|
895
|
<xsl:variable name="exceptionDetailsId" select="concat($methodId, '_exception')"/>
|
896
|
<tr id="{concat($methodId, '_row')}" class="{testng:testMethodStatus(.)}">
|
897
|
<xsl:if test="testng:isFilterSelected(@status) != 'true'">
|
898
|
<!--<xsl:attribute name="style" select="'display: none;'"/>-->
|
899
|
</xsl:if>
|
900
|
<td width="100%" class="firstMethodCell">
|
901
|
<a onclick="toggleDetailsVisibility('{$detailsId}')">
|
902
|
<xsl:value-of select="concat(@name, '(', testng:trim(testng:concatParams(./params/param)), ')')"/>
|
903
|
</a>
|
904
|
</td>
|
905
|
<td nowrap="true">
|
906
|
<xsl:value-of select="substring(@started-at, 12, 8)"/>
|
907
|
</td>
|
908
|
<td nowrap="true" align="right">
|
909
|
<xsl:value-of select="testng:formatDuration(@duration-ms)"/>
|
910
|
</td>
|
911
|
<td nowrap="true">
|
912
|
<xsl:if test="./exception">
|
913
|
<a onclick="toggleDetailsVisibility('{$exceptionDetailsId}')">
|
914
|
<xsl:value-of select="concat(exception/@class, ': ', exception/message)"/>
|
915
|
</a>
|
916
|
</xsl:if>
|
917
|
 
|
918
|
</td>
|
919
|
</tr>
|
920
|
<tr>
|
921
|
<td colspan="4" class="detailsBox">
|
922
|
<div id="{$detailsId}" class="testMethodDetails">
|
923
|
<xsl:call-template name="formField">
|
924
|
<xsl:with-param name="label" select="'Name'"/>
|
925
|
<xsl:with-param name="value" select="@name"/>
|
926
|
</xsl:call-template>
|
927
|
<xsl:call-template name="formField">
|
928
|
<xsl:with-param name="label" select="'Description'"/>
|
929
|
<xsl:with-param name="value" select="@description"/>
|
930
|
</xsl:call-template>
|
931
|
<xsl:call-template name="formField">
|
932
|
<xsl:with-param name="label" select="'Signature'"/>
|
933
|
<xsl:with-param name="value" select="@signature"/>
|
934
|
</xsl:call-template>
|
935
|
<xsl:if test="./params">
|
936
|
<xsl:call-template name="formField">
|
937
|
<xsl:with-param name="label" select="'Parameters'"/>
|
938
|
<xsl:with-param name="value" select="testng:concatParams(./params/param)"/>
|
939
|
</xsl:call-template>
|
940
|
</xsl:if>
|
941
|
<xsl:call-template name="formField">
|
942
|
<xsl:with-param name="label" select="'Start time'"/>
|
943
|
<xsl:with-param name="value" select="substring(@started-at, 12, 8)"/>
|
944
|
</xsl:call-template>
|
945
|
<xsl:call-template name="formField">
|
946
|
<xsl:with-param name="label" select="'End time'"/>
|
947
|
<xsl:with-param name="value" select="substring(@finished-at, 12, 8)"/>
|
948
|
</xsl:call-template>
|
949
|
<xsl:call-template name="formField">
|
950
|
<xsl:with-param name="label" select="'Duration'"/>
|
951
|
<xsl:with-param name="value" select="testng:formatDuration(@duration-ms)"/>
|
952
|
</xsl:call-template>
|
953
|
<xsl:call-template name="formField">
|
954
|
<xsl:with-param name="label" select="'In groups:'"/>
|
955
|
<xsl:with-param name="value" select="@groups"/>
|
956
|
</xsl:call-template>
|
957
|
<xsl:if test="@depends-on-methods">
|
958
|
<xsl:call-template name="formFieldList">
|
959
|
<xsl:with-param name="label" select="'Depends on methods'"/>
|
960
|
<xsl:with-param name="value"
|
961
|
select="tokenize(@depends-on-methods, ',')"/>
|
962
|
</xsl:call-template>
|
963
|
</xsl:if>
|
964
|
<xsl:if test="@depends-on-groups">
|
965
|
<xsl:call-template name="formFieldList">
|
966
|
<xsl:with-param name="label" select="'Depends on groups'"/>
|
967
|
<xsl:with-param name="value"
|
968
|
select="tokenize(@depends-on-groups, ',')"/>
|
969
|
</xsl:call-template>
|
970
|
</xsl:if>
|
971
|
</div>
|
972
|
</td>
|
973
|
</tr>
|
974
|
<tr>
|
975
|
<xsl:if test="exception">
|
976
|
<td colspan="4" class="detailsBox">
|
977
|
<div id="{$exceptionDetailsId}" class="testMethodDetails">
|
978
|
<xsl:choose>
|
979
|
<xsl:when test="exception/full-stacktrace">
|
980
|
<pre style="padding: 5px; margin: 0;">
|
981
|
<xsl:value-of select="testng:trim(exception/full-stacktrace)"/>
|
982
|
</pre>
|
983
|
</xsl:when>
|
984
|
<xsl:when test="exception/short-stacktrace and not (exception/full-stacktrace)">
|
985
|
<pre style="padding: 5px; margin: 0;">
|
986
|
<xsl:value-of select="testng:trim(exception/short-stacktrace)"/>
|
987
|
</pre>
|
988
|
</xsl:when>
|
989
|
<xsl:otherwise>
|
990
|
<pre style="padding: 5px; margin: 0;"><No stacktrace information></pre>
|
991
|
</xsl:otherwise>
|
992
|
</xsl:choose>
|
993
|
</div>
|
994
|
</td>
|
995
|
</xsl:if>
|
996
|
</tr>
|
997
|
</xsl:for-each>
|
998
|
</xsl:template>
|
999
|
|
1000
|
<xsl:template name="suiteTestCasesLinks">
|
1001
|
<xsl:param name="testCases"/>
|
1002
|
<xsl:for-each select="$testCases">
|
1003
|
<xsl:sort order="ascending" select="if (compare($testNgXslt.sortTestCaseLinks, 'true') = 0) then @name else ''"/>
|
1004
|
<div class="testCaseLink"
|
1005
|
onclick="javscript:selectTestCaseLink(this); parent.content.location='{testng:testCaseContentFileName(.)}'">
|
1006
|
<div class="{if (count(./class/test-method[@status='FAIL']) > 0)
|
1007
|
then 'testCaseFail'
|
1008
|
else if ((count(./class/test-method[@status='FAIL']) = 0) and (count(./class/test-method[@status='PASS']) > 0))
|
1009
|
then 'testCasePass'
|
1010
|
else 'testCaseSkip'}">
|
1011
|
</div>
|
1012
|
<xsl:value-of select="@name"/>
|
1013
|
</div>
|
1014
|
</xsl:for-each>
|
1015
|
</xsl:template>
|
1016
|
|
1017
|
<xsl:template name="suiteTestCasesContentFiles">
|
1018
|
<xsl:param name="testCases"/>
|
1019
|
<xsl:for-each select="$testCases">
|
1020
|
<xsl:result-document href="{testng:absolutePath(testng:testCaseContentFileName(.))}" format="xhtml">
|
1021
|
<html>
|
1022
|
<xsl:call-template name="htmlHead"/>
|
1023
|
<body>
|
1024
|
<table width="100%" style="font-size: 16px; margin-bottom: 10px;" cellspacing="1">
|
1025
|
<tr>
|
1026
|
<td width="100%">
|
1027
|
Test case
|
1028
|
<b>
|
1029
|
<xsl:value-of select="./@name"/>
|
1030
|
</b>
|
1031
|
</td>
|
1032
|
<xsl:call-template name="percentageOverview">
|
1033
|
<xsl:with-param name="failedCount" select="testng:testCaseMethodsCount(., 'FAIL')"/>
|
1034
|
<xsl:with-param name="passedCount" select="testng:testCaseMethodsCount(., 'PASS')"/>
|
1035
|
<xsl:with-param name="skippedCount"
|
1036
|
select="testng:testCaseMethodsCount(., 'SKIP')"/>
|
1037
|
<xsl:with-param name="totalCount" select="testng:testCaseMethodsCount(., '*')"/>
|
1038
|
<xsl:with-param name="totalDuration"
|
1039
|
select="testng:formatDuration(./@duration-ms)"/>
|
1040
|
</xsl:call-template>
|
1041
|
</tr>
|
1042
|
</table>
|
1043
|
<xsl:call-template name="testMethods">
|
1044
|
<xsl:with-param name="classes" select="./class"/>
|
1045
|
<xsl:with-param name="failedMethods" select="./class/test-method[@status='FAIL']"/>
|
1046
|
<xsl:with-param name="passedMethods" select="./class/test-method[@status='PASS']"/>
|
1047
|
<xsl:with-param name="skipedMethods" select="./class/test-method[@status='SKIP']"/>
|
1048
|
</xsl:call-template>
|
1049
|
<xsl:call-template name="powered-by"/>
|
1050
|
</body>
|
1051
|
</html>
|
1052
|
</xsl:result-document>
|
1053
|
</xsl:for-each>
|
1054
|
</xsl:template>
|
1055
|
|
1056
|
<xsl:template name="percentageOverview">
|
1057
|
<xsl:param name="failedCount"/>
|
1058
|
<xsl:param name="passedCount"/>
|
1059
|
<xsl:param name="skippedCount"/>
|
1060
|
<xsl:param name="totalCount"/>
|
1061
|
<xsl:param name="totalDuration"/>
|
1062
|
<td style="background-color: #FFBBBB; padding: 3px 3px 3px 0;" align="center">
|
1063
|
<div style="width: 50px;">
|
1064
|
<xsl:value-of select="$failedCount"/>
|
1065
|
</div>
|
1066
|
</td>
|
1067
|
<td style="background-color: lightgreen; padding: 3px 3px 3px 0;" align="center">
|
1068
|
<div style="width: 50px;">
|
1069
|
<xsl:value-of select="$passedCount"/>
|
1070
|
</div>
|
1071
|
</td>
|
1072
|
<td style="background-color: #FFFFBB; padding: 3px 3px 3px 0;" align="center">
|
1073
|
<div style="width: 50px;">
|
1074
|
<xsl:value-of select="$skippedCount"/>
|
1075
|
</div>
|
1076
|
</td>
|
1077
|
<td align="center" style="background-color: #eaf0f7; padding: 3px 3px 3px 0;">
|
1078
|
<div style="width: 50px;">
|
1079
|
<xsl:value-of select="$totalCount"/>
|
1080
|
</div>
|
1081
|
</td>
|
1082
|
<td align="center" style="font-weight: bold; background-color: #eaf0f7; padding: 3px 3px 3px 0;">
|
1083
|
<div style="width: 50px;">
|
1084
|
<xsl:value-of
|
1085
|
select="if ($totalCount > 0) then format-number($passedCount div $totalCount, '###%') else '100%'"/>
|
1086
|
</div>
|
1087
|
</td>
|
1088
|
<xsl:if test="compare($testNgXslt.showRuntimeTotals, 'true') = 0">
|
1089
|
<td style="background-color: #eaf0f7; padding: 3px 3px 3px 0;" align="center" nowrap="true">
|
1090
|
<xsl:value-of select="$totalDuration"/>
|
1091
|
</td>
|
1092
|
</xsl:if>
|
1093
|
</xsl:template>
|
1094
|
|
1095
|
<xsl:template name="powered-by">
|
1096
|
<div style="margin-top: 15px; color: gray; text-align: center; font-size: 9px;">
|
1097
|
Generated with
|
1098
|
<a href="http://code.google.com/p/testng-xslt/" style="color: #8888aa;" target="_blank">
|
1099
|
TestNG XSLT
|
1100
|
</a>
|
1101
|
</div>
|
1102
|
</xsl:template>
|
1103
|
|
1104
|
</xsl:stylesheet>
|