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
1f1d0872
...
1f1d087229c603131cf34e5fcbe2228735b834d4
authored
2012-12-02 14:08:13 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed #294 - Automatically fail test on any runtime error or timeout
1 parent
26ee5cf5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
CHANGELOG.md
docs
modules/tester.js
CHANGELOG.md
View file @
1f1d087
...
...
@@ -47,6 +47,7 @@ The whole [CapserJS test suite](https://github.com/n1k0/casperjs/tree/master/tes
### Bugfixes & enhancements
-
fixed
[
#294
](
https://github.com/n1k0/casperjs/issues/294
)
- Automatically fail test on any runtime error or timeout
-
fixed
[
#281
](
https://github.com/n1k0/casperjs/issues/281
)
-
`Casper.evaluate()`
should take an array as context not object
-
fixed
[
#266
](
https://github.com/n1k0/casperjs/issues/266
)
- Fix
`tester`
module and its self tests
-
fixed
[
#268
](
https://github.com/n1k0/casperjs/issues/266
)
- Wrong message on step timeout
...
...
docs
@
ea64d991
Subproject commit
9ddb0c6eb79d0c6b176d7bf41187e06b2e8fc708
Subproject commit
ea64d9917aaf7268a86b9fad010203615a29b9e0
...
...
modules/tester.js
View file @
1f1d087
...
...
@@ -121,6 +121,23 @@ var Tester = function Tester(casper, options) {
}
}
});
// casper events
this
.
casper
.
on
(
'error'
,
function
onCasperError
(
msg
,
backtrace
)
{
var
line
=
0
;
if
(
!
utils
.
isString
(
msg
)
&&
msg
.
indexOf
(
this
.
SKIP_MESSAGE
)
===
-
1
)
{
try
{
line
=
backtrace
[
0
].
line
;
}
catch
(
e
)
{}
}
this
.
test
.
uncaughtError
(
msg
,
this
.
test
.
currentTestFile
,
line
);
this
.
test
.
done
();
});
this
.
casper
.
on
(
'step.error'
,
function
onStepError
(
e
)
{
this
.
test
.
uncaughtError
(
e
,
this
.
test
.
currentTestFile
);
this
.
test
.
done
();
});
};
// Tester class is an EventEmitter
...
...
@@ -672,23 +689,6 @@ Tester.prototype.configure = function configure() {
this
.
casper
.
options
.
onWaitTimeout
=
function
test_onWaitTimeout
(
timeout
)
{
tester
.
fail
(
f
(
"Wait timeout occured (%dms)"
,
timeout
));
};
// events
this
.
casper
.
on
(
'error'
,
function
(
msg
,
backtrace
)
{
if
(
!
utils
.
isString
(
msg
)
&&
msg
.
indexOf
(
this
.
SKIP_MESSAGE
)
===
-
1
)
{
var
line
=
0
;
try
{
line
=
backtrace
[
0
].
line
;
}
catch
(
e
)
{}
tester
.
uncaughtError
(
msg
,
tester
.
currentTestFile
,
line
);
}
tester
.
done
();
});
this
.
casper
.
on
(
'step.error'
,
function
onStepError
(
e
)
{
tester
.
uncaughtError
(
e
,
tester
.
currentTestFile
);
tester
.
done
();
});
};
/**
...
...
Please
register
or
sign in
to post a comment