Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
41e47503
Commit
41e47503
authored
Jun 29, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some interactivity to XSLT stylesheet using javascript.
parent
7d6dcc93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
141 additions
and
21 deletions
+141
-21
style.xsl
test/test-automation/style.xsl
+141
-21
No files found.
test/test-automation/style.xsl
View file @
41e47503
...
...
@@ -7,16 +7,123 @@
<html>
<head>
<title>
Test report
</title>
<script
src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"
/>
<script
type=
"text/javascript"
>
$(document).ready(function() {
$("span.show-tests").click(function() {
var content = $(this).html();
var id = $(this).attr('uid');
var searchString = "div.tests[uid="+id+"]";
if(content == '[Hide tests]') {
$(searchString).hide("fast");
$(this).text('[Show tests]');
} else {
$(searchString).show("fast");
$(this).text('[Hide tests]');
}
});
$("span.show-asserts").click(function() {
var content = $(this).html();
var id = $(this).attr('uid');
console.log("assert uid" + id);
var searchString = "div.asserts[uid="+id+"]";
if(content == '[Hide Assert Summary]') {
console.log("hide now");
$(searchString).hide("fast");
$(this).text('[Show Assert Summary]');
} else {
console.log("show now");
$(searchString).show("fast");
$(this).text('[Hide Assert Summary]');
}
});
$("span.show-all-tests").click(function() {
var content = $(this).html();
var searchString = "div.tests";
if(content == '[Hide All Tests]') {
console.log("hide now");
$(searchString).hide("fast");
$(this).text('[Show All Tests]');
/* handle the individual '[show tests]' switcher */
$("span.show-tests[uid]").text('[Show tests]');
} else {
console.log("show now");
$(searchString).show("fast");
$(this).text('[Hide All Tests]');
/* handle the individual '[show tests]' switcher */
$("span.show-tests[uid]").text('[Hide tests]');
}
});
$("span.show-everything").click(function() {
var content = $(this).html();
var searchString = "div.tests";
if(content == '[Hide Everything]') {
console.log("hide now");
$("div.tests").hide("fast");
$("div.asserts").hide("fast");
$(this).text('[Show Everything]');
/* handle the individual switchers */
$("span.show-tests[uid]").text('[Show tests]');
$("span.show-asserts[uid]").text('[Show Assert Summary]');
} else {
console.log("show now");
$("div.tests").show("fast");
$("div.asserts").show("fast");
$(this).text('[Hide Everything]');
/* handle the individual switchers */
$("span.show-tests[uid]").text('[Hide tests]');
$("span.show-asserts[uid]").text('[Hide Assert Summary]');
}
});
/* Initially everything is hidden */
$("div.tests").hide();
$("div.asserts").hide();
});
</script>
<style>
div {
div
, h1
{
padding: 3px 10px 2px 10px;
}
h3 {
padding: 0 0 0 0;
}
.document {
font-family: Arial;
font-size: 11pt;
background-color: #E
EEEEE
;
background-color: #E
DEDED
;
}
.description {
...
...
@@ -27,18 +134,23 @@ div {
font-weight: bold;
}
.aligner {
width: 100px;
float: left;
.switch {
font-style: italic;
color: rgb(10, 10, 200);
font-size: 10pt;
cursor: pointer;
}
.passedTest {
background-color: green;
}
.failedTest {
background-color: red;
}
.statistics {
}
.ident {
position: relative;
left: 100px;
}
</style>
...
...
@@ -56,31 +168,39 @@ div {
<br/>
<span
class=
"title"
>
Statistics:
</span><br/>
<div
class=
"statistics"
>
<span
class=
"aligner"
>
Suites:
</span>
<xsl:value-of
select=
"testlog/numSuites"
/>
<br/>
<span
class=
"aligner"
>
Tests in total:
</span>
<xsl:value-of
select=
"testlog/numTests"
/>
<br/>
<span>
Suites:
</span>
<xsl:value-of
select=
"testlog/numSuites"
/>
<br/>
<span>
Tests in total:
</span>
<xsl:value-of
select=
"testlog/numTests"
/>
<br/>
<div>
<span
class=
"aligner"
>
Passed tests:
</span><xsl:value-of
select=
"testlog/numPassedTests"
/>
<br/>
<span
class=
"aligner"
>
Failed tests:
</span><xsl:value-of
select=
"testlog/numFailedTests"
/>
<br/>
<span>
Passed tests:
</span><xsl:value-of
select=
"testlog/numPassedTests"
/>
<br/>
<span>
Failed tests:
</span><xsl:value-of
select=
"testlog/numFailedTests"
/>
<br/>
</div>
</div>
</div>
<h3>
Test results:
</h3>
<div>
<h3>
Test results:
</h3>
<span
class=
"switch show-all-tests"
>
[Show All Tests]
</span>
|
<span
class=
"switch show-everything"
>
[Show Everything]
</span>
</div>
<xsl:for-each
select=
"testlog/suite"
>
<div
id=
"suite"
>
Suite:
<xsl:value-of
select=
"name"
/>
(
<xsl:value-of
select=
"startTime"
/>
)
<div
id
=
"suiteInfo"
>
<div
class
=
"suiteInfo"
>
Tests: passed
<xsl:value-of
select=
"testsPassed"
/>
, failed
<xsl:value-of
select=
"testsFailed"
/>
, skipped
<xsl:value-of
select=
"testsSkipped"
/>
.
<br/>
Total runtime:
<xsl:value-of
select=
"totalRuntime"
/>
seconds.
<br/>
Show/hide tests.
<div
id=
"tests
"
>
<span
class=
"show-tests switch"
uid=
"{generate-id(test)}"
>
[Show tests]
</span>
<div
class=
"tests"
uid=
"{generate-id(test)}
"
>
<xsl:for-each
select=
"test"
>
<div>
Name:
<xsl:value-of
select=
"name"
/>
(
<xsl:value-of
select=
"startTime"
/>
-
<xsl:value-of
select=
"endTime"
/>
)
<br/>
Total runtime:
<xsl:value-of
select=
"totalRuntime"
/>
<br/>
Description:
<span
class=
"description"
>
<xsl:value-of
select=
"description"
/>
</span><br/>
Total runtime:
<xsl:value-of
select=
"totalRuntime"
/>
seconds
<br/>
Result:
<xsl:value-of
select=
"result"
/>
<br/>
Show/hide assert info
<br/>
<div
id=
"asserts"
>
<span
class=
"switch show-asserts"
uid=
"{generate-id(assertSummary)}"
>
[Show Assert Summary]
</span><br/>
<div
class=
"asserts"
uid=
"{generate-id(assertSummary)}"
>
<xsl:for-each
select=
"assert"
>
<div
id=
"assert"
>
Assert name:
<xsl:value-of
select=
"name"
/>
<br/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment