Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
38d27611
...
38d276119c4125b174d78048907c7a1aaa0cfb7e
authored
2013-12-10 10:42:16 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated xunit tests to refect use of getSerializedXML
1 parent
113258a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
modules/xunit.js
tests/suites/xunit.js
modules/xunit.js
View file @
38d2761
...
...
@@ -159,6 +159,7 @@ XUnitExporter.prototype.getXML = function getXML() {
* @return string
*/
XUnitExporter
.
prototype
.
getSerializedXML
=
function
getSerializedXML
(
xml
)
{
"use strict"
;
var
serializer
=
new
XMLSerializer
();
return
'<?xml version="1.0" encoding="UTF-8"?>'
+
serializer
.
serializeToString
(
this
.
getXML
());
}
...
...
tests/suites/xunit.js
View file @
38d2761
...
...
@@ -7,7 +7,7 @@ casper.test.begin('XUnitReporter() initialization', 1, function suite(test) {
var
xunit
=
require
(
'xunit'
).
create
();
var
results
=
new
tester
.
TestSuiteResult
();
xunit
.
setResults
(
results
);
test
.
assertTruthy
(
xunit
.
getXML
());
test
.
assertTruthy
(
xunit
.
get
Serialized
XML
());
test
.
done
();
});
...
...
@@ -25,7 +25,7 @@ casper.test.begin('XUnitReporter() can hold test suites', 4, function suite(test
});
results
.
push
(
suite2
);
xunit
.
setResults
(
results
);
casper
.
start
().
setContent
(
xunit
.
getXML
());
casper
.
start
().
setContent
(
xunit
.
get
Serialized
XML
());
test
.
assertEvalEquals
(
function
()
{
return
__utils__
.
findAll
(
'testsuite'
).
length
;
},
2
);
...
...
@@ -50,7 +50,7 @@ casper.test.begin('XUnitReporter() can hold a suite with a succesful test', 1, f
});
results
.
push
(
suite1
);
xunit
.
setResults
(
results
);
casper
.
start
().
setContent
(
xunit
.
getXML
());
casper
.
start
().
setContent
(
xunit
.
get
Serialized
XML
());
test
.
assertExists
(
'testsuite[name="foo"][package="foo"][tests="1"][failures="0"] testcase[name="footext"]'
);
test
.
done
();
});
...
...
@@ -70,7 +70,7 @@ casper.test.begin('XUnitReporter() can handle a failed test', 2, function suite(
});
results
.
push
(
suite1
);
xunit
.
setResults
(
results
);
casper
.
start
().
setContent
(
xunit
.
getXML
());
casper
.
start
().
setContent
(
xunit
.
get
Serialized
XML
());
test
.
assertExists
(
'testsuite[name="foo"][package="foo"][tests="1"][failures="1"] testcase[name="footext"] failure[type="footype"]'
);
test
.
assertEquals
(
casper
.
getElementInfo
(
'failure[type="footype"]'
).
text
,
'footext'
);
test
.
done
();
...
...
Please
register
or
sign in
to post a comment