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
45a46090
...
45a46090f91217af89084cbfa81966969691da77
authored
2012-09-23 11:35:40 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'chiefcll/fix-test-timeout' into pr-202
2 parents
e524f490
fd71a035
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
modules/casper.js
modules/tester.js
modules/casper.js
View file @
45a4609
...
...
@@ -1091,7 +1091,7 @@ Casper.prototype.runStep = function runStep(step) {
if
(
utils
.
isNumber
(
this
.
options
.
stepTimeout
)
&&
this
.
options
.
stepTimeout
>
0
)
{
var
stepTimeoutCheckInterval
=
setInterval
(
function
_check
(
self
,
start
,
stepNum
)
{
if
(
new
Date
().
getTime
()
-
start
>
self
.
options
.
stepTimeout
)
{
if
(
self
.
step
===
stepNum
)
{
if
(
(
self
.
test
.
currentSuiteNum
+
"-"
+
self
.
step
)
===
stepNum
)
{
self
.
emit
(
'step.timeout'
);
if
(
utils
.
isFunction
(
self
.
options
.
onStepTimeout
))
{
self
.
options
.
onStepTimeout
.
call
(
self
,
self
);
...
...
@@ -1101,7 +1101,7 @@ Casper.prototype.runStep = function runStep(step) {
}
clearInterval
(
stepTimeoutCheckInterval
);
}
},
this
.
options
.
stepTimeout
,
this
,
new
Date
().
getTime
(),
this
.
step
);
},
this
.
options
.
stepTimeout
,
this
,
new
Date
().
getTime
(),
this
.
test
.
currentSuiteNum
+
"-"
+
this
.
step
);
}
this
.
emit
(
'step.start'
,
step
);
stepResult
=
step
.
call
(
this
,
this
);
...
...
modules/tester.js
View file @
45a4609
...
...
@@ -54,6 +54,7 @@ var Tester = function Tester(casper, options) {
}
this
.
currentTestFile
=
null
;
this
.
currentSuiteNum
=
0
;
this
.
exporter
=
require
(
'xunit'
).
create
();
this
.
loadIncludes
=
{
includes
:
[],
...
...
@@ -752,17 +753,17 @@ var Tester = function Tester(casper, options) {
this
.
bar
(
f
(
"No test file found in %s, aborting."
,
Array
.
prototype
.
slice
.
call
(
arguments
)),
"RED_BAR"
);
casper
.
exit
(
1
);
}
var
current
=
0
;
self
.
currentSuiteNum
=
0
;
var
interval
=
setInterval
(
function
_check
(
self
)
{
if
(
self
.
running
)
{
return
;
}
if
(
current
===
testFiles
.
length
)
{
if
(
self
.
currentSuiteNum
===
testFiles
.
length
)
{
self
.
emit
(
'tests.complete'
);
clearInterval
(
interval
);
}
else
{
self
.
runTest
(
testFiles
[
current
]);
current
++
;
self
.
runTest
(
testFiles
[
self
.
currentSuiteNum
]);
self
.
currentSuiteNum
++
;
}
},
100
,
this
);
};
...
...
Please
register
or
sign in
to post a comment