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
fd71a035
...
fd71a0356b2a80625b03a6e4b6d647e0b5961b11
authored
2012-08-03 14:48:53 -0400
by
Chris Lorenzo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix test status timeouts when running multiple suites
1 parent
5ed461e8
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 @
fd71a03
...
...
@@ -1087,7 +1087,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
);
...
...
@@ -1097,7 +1097,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 @
fd71a03
...
...
@@ -54,6 +54,7 @@ var Tester = function Tester(casper, options) {
}
this
.
currentTestFile
=
null
;
this
.
currentSuiteNum
=
0
;
this
.
exporter
=
require
(
'xunit'
).
create
();
this
.
includes
=
[];
this
.
running
=
false
;
...
...
@@ -738,17 +739,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