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
1932d880
...
1932d88098d3ea8f848fb8aa648f249a580f4b84
authored
2012-12-31 11:13:04 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added Casper.options.onRunComplete() handler
1 parent
783e7dfc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
modules/casper.js
modules/casper.js
View file @
1932d88
...
...
@@ -96,6 +96,9 @@ var Casper = function Casper(options) {
onPageInitialized
:
null
,
onResourceReceived
:
null
,
onResourceRequested
:
null
,
onRunComplete
:
function
_onRunComplete
()
{
this
.
exit
();
},
onStepComplete
:
null
,
onStepTimeout
:
function
_onStepTimeout
(
timeout
,
stepNum
)
{
this
.
die
(
"Maximum step execution timeout exceeded for step "
+
stepNum
);
...
...
@@ -343,9 +346,8 @@ Casper.prototype.checkStep = function checkStep(self, onComplete) {
self
.
emit
(
'run.complete'
);
if
(
utils
.
isFunction
(
onComplete
))
{
onComplete
.
call
(
self
,
self
);
}
else
{
// default behavior is to exit
self
.
exit
();
}
else
if
(
utils
.
isFunction
(
self
.
options
.
onRunComplete
))
{
self
.
options
.
onRunComplete
.
call
(
self
,
self
);
}
}
};
...
...
Please
register
or
sign in
to post a comment