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
0c39e151
...
0c39e1513893e83efbcefd3adb36e658b593c523
authored
2013-01-06 11:37:33 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added --concise option
1 parent
6fab583f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
modules/tester.js
tests/run.js
tests/suites/clientutils.js
modules/tester.js
View file @
0c39e15
...
...
@@ -99,6 +99,7 @@ var Tester = function Tester(casper, options) {
post
:
[]
};
this
.
options
=
utils
.
mergeObjects
({
concise
:
false
,
// concise output?
failFast
:
false
,
// terminates a suite as soon as a test fails?
failText
:
"FAIL"
,
// text to use for a succesful test
passText
:
"PASS"
,
// text to use for a failed test
...
...
@@ -818,7 +819,9 @@ Tester.prototype.begin = function begin(description, planned, suiteFn) {
return
this
.
queue
.
push
(
arguments
);
}
description
=
description
||
"Untitled suite in "
+
this
.
currentTestFile
;
this
.
comment
(
description
);
if
(
!
this
.
options
.
concise
)
{
this
.
comment
(
description
);
}
this
.
currentSuite
=
new
TestCaseResult
({
name
:
description
,
file
:
this
.
currentTestFile
,
...
...
@@ -836,6 +839,13 @@ Tester.prototype.begin = function begin(description, planned, suiteFn) {
}
this
.
done
();
}
if
(
this
.
options
.
concise
)
{
this
.
casper
.
echo
([
this
.
colorize
(
'PASS'
,
'INFO'
),
this
.
formatMessage
(
description
),
this
.
colorize
(
f
(
'(%d test%s)'
,
planned
,
planned
>
1
?
's'
:
''
),
'INFO'
)
].
join
(
' '
));
}
};
/**
...
...
@@ -1060,7 +1070,9 @@ Tester.prototype.processAssertionResult = function processAssertionResult(result
style
=
'RED_BAR'
;
status
=
this
.
options
.
failText
;
}
this
.
casper
.
echo
([
this
.
colorize
(
status
,
style
),
this
.
formatMessage
(
message
)].
join
(
' '
));
if
(
!
this
.
options
.
concise
)
{
this
.
casper
.
echo
([
this
.
colorize
(
status
,
style
),
this
.
formatMessage
(
message
)].
join
(
' '
));
}
this
.
emit
(
eventName
,
result
);
if
(
this
.
options
.
failFast
&&
!
result
.
success
)
{
throw
this
.
SKIP_MESSAGE
;
...
...
tests/run.js
View file @
0c39e15
...
...
@@ -60,6 +60,7 @@ function checkArgs() {
casper
.
options
.
colorizerType
=
cls
;
casper
.
colorizer
=
colorizer
.
create
(
cls
);
}
casper
.
test
.
options
.
concise
=
casper
.
cli
.
get
(
'concise'
)
||
false
;
casper
.
test
.
options
.
failFast
=
casper
.
cli
.
get
(
'fail-fast'
)
||
false
;
// test paths are passed as args
...
...
tests/suites/clientutils.js
View file @
0c39e15
...
...
@@ -120,7 +120,6 @@ casper.test.begin('ClientUtils.getElementBounds() tests', 3, function(test) {
);
});
casper
.
then
(
function
()
{
test
.
comment
(
'Casper.getElementsBounds()'
);
var
html
=
'<div id="boxes">'
;
html
+=
' <div style="position:fixed;top:10px;left:11px;width:50px;height:60px"></div>'
;
html
+=
' <div style="position:fixed;top:20px;left:21px;width:70px;height:80px"></div>'
;
...
...
Please
register
or
sign in
to post a comment