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
04be70a0
...
04be70a062a6347626345c826ae9ccea95bfcfd9
authored
2012-12-19 21:07:05 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
sync with master
2 parents
ce3860f5
5e488845
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
10 deletions
CHANGELOG.md
bin/casperjs
docs
modules/casper.js
modules/clientutils.js
modules/tester.js
CHANGELOG.md
View file @
04be70a
...
...
@@ -4,6 +4,7 @@ CasperJS Changelog
XXXX-XX-XX, v1.0.0
------------------
-
fixed
[
#215
](
https://github.com/n1k0/casperjs/issues/215
)
- fixed broken
`--fail-fast`
option creating an endless loop on error
-
fixed
`Tester.renderFailureDetails()`
which couldn't print failure details correctly in certain circumstances
-
fixed
`Casper.getHTML()`
wasn't retrieving active frame contents when using
`Casper.withFrame()`
-
merged PR
[
#322
](
https://github.com/n1k0/casperjs/pull/322
)
- Support number in
`Casper.withFrame()`
...
...
bin/casperjs
View file @
04be70a
...
...
@@ -45,7 +45,7 @@ CASPER_PATH = os.path.abspath(os.path.join(os.path.dirname(resolve(__file__)), '
PHANTOMJS_ARGS
=
[]
SYS_ARGS
=
sys
.
argv
[
1
:]
if
SYS_ARGS
[
0
]
==
'__selfcommandtest'
:
if
len
(
SYS_ARGS
)
and
SYS_ARGS
[
0
]
==
'__selfcommandtest'
:
print
(
'Starting Python executable tests...'
)
pkg_version
=
json
.
loads
(
open
(
'package.json'
)
.
read
())
.
get
(
'version'
)
scripts_path
=
os
.
path
.
join
(
CASPER_PATH
,
'tests'
,
'commands'
)
...
...
docs
@
1f932d7f
Subproject commit
0f6c923dbfe9bb605adfa5c9d6c8cd3ac1d56586
Subproject commit
1f932d7f7b77014f7abb7a0e53e8ef1f05dd4d3e
...
...
modules/casper.js
View file @
04be70a
...
...
@@ -158,7 +158,7 @@ var Casper = function Casper(options) {
this
.
on
(
'error'
,
function
(
msg
,
backtrace
)
{
if
(
msg
===
this
.
test
.
SKIP_MESSAGE
)
{
return
this
.
warn
(
f
(
'--fail-fast: aborted remaining tests in "%s"'
,
this
.
test
.
currentTestFile
))
;
return
;
}
var
c
=
this
.
getColorizer
();
var
match
=
/^
(
.*
)
: __mod_error
(
.*
)
::
(
.*
)
/
.
exec
(
msg
);
...
...
modules/clientutils.js
View file @
04be70a
...
...
@@ -644,7 +644,7 @@
}
else
if
(
typeof
data
===
"string"
)
{
dataString
=
data
;
}
xhr
.
setRequestHeader
(
"Content-
t
ype"
,
"application/x-www-form-urlencoded"
);
xhr
.
setRequestHeader
(
"Content-
T
ype"
,
"application/x-www-form-urlencoded"
);
}
xhr
.
send
(
method
===
"POST"
?
dataString
:
null
);
return
xhr
.
responseText
;
...
...
modules/tester.js
View file @
04be70a
...
...
@@ -61,10 +61,13 @@ var Tester = function Tester(casper, options) {
throw
new
CasperError
(
"Tester needs a Casper instance"
);
}
var
self
=
this
;
this
.
casper
=
casper
;
this
.
SKIP_MESSAGE
=
'__termination__'
;
this
.
aborted
=
false
;
this
.
executed
=
0
;
this
.
currentTestFile
=
null
;
this
.
currentSuite
=
undefined
;
...
...
@@ -118,19 +121,26 @@ var Tester = function Tester(casper, options) {
if
(
!
phantom
.
casperTest
)
{
return
;
}
if
(
msg
===
self
.
SKIP_MESSAGE
)
{
this
.
warn
(
f
(
'--fail-fast: aborted remaining tests in "%s"'
,
self
.
currentTestFile
));
self
.
aborted
=
true
;
return
self
.
done
();
}
var
line
=
0
;
if
(
!
utils
.
isString
(
msg
)
&&
msg
.
indexOf
(
this
.
SKIP_MESSAGE
)
===
-
1
)
{
if
(
!
utils
.
isString
(
msg
))
{
try
{
line
=
backtrace
[
0
].
line
;
}
catch
(
e
)
{}
}
this
.
test
.
uncaughtError
(
msg
,
this
.
test
.
currentTestFile
,
line
,
backtrace
);
this
.
test
.
done
();
self
.
uncaughtError
(
msg
,
self
.
currentTestFile
,
line
,
backtrace
);
self
.
done
();
});
this
.
casper
.
on
(
'step.error'
,
function
onStepError
(
e
)
{
this
.
test
.
uncaughtError
(
e
,
this
.
test
.
currentTestFile
);
this
.
test
.
done
();
if
(
e
.
message
!==
self
.
SKIP_MESSAGE
)
{
self
.
uncaughtError
(
e
,
self
.
currentTestFile
);
}
self
.
done
();
});
};
...
...
@@ -1064,9 +1074,10 @@ Tester.prototype.runSuites = function runSuites() {
if
(
self
.
running
)
{
return
;
}
if
(
self
.
currentSuiteNum
===
testFiles
.
length
)
{
if
(
self
.
currentSuiteNum
===
testFiles
.
length
||
self
.
aborted
)
{
self
.
emit
(
'tests.complete'
);
clearInterval
(
interval
);
self
.
aborted
=
false
;
}
else
{
self
.
runTest
(
testFiles
[
self
.
currentSuiteNum
]);
self
.
currentSuiteNum
++
;
...
...
Please
register
or
sign in
to post a comment