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
f92de3f9
...
f92de3f9485803222230ce77ac1f3c8c9924d083
authored
2012-10-19 12:36:27 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed #250 - prevent self tests to be run using the `casper test` command
1 parent
2f60c14c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
CHANGELOG.md
bin/bootstrap.js
tests/run.js
CHANGELOG.md
View file @
f92de3f
...
...
@@ -65,6 +65,7 @@ The documentation has been [updated accordingly](http://casperjs.org/api.html#ca
-
[
Casper.resourceExists()
](
http://casperjs.org/api.html#casper.resourceExists
)
and related functions now checks for non HTTP-404 received responses.
-
closes
[
#230
](
https://github.com/n1k0/casperjs/issues/230
)
- added
[
`ClientUtils.getElementsBound()`
](
http://casperjs.org/api.html#clientutils.getElementsBounds
)
and
[
`Casper.getElementsBound()`
](
http://casperjs.org/api.html#casper.getElementsBounds
)
-
fixed
[
#250
](
https://github.com/n1k0/casperjs/issues/250
)
- prevent self tests to be run using the standard
`casper test`
command
-
fixes
[
#254
](
https://github.com/n1k0/casperjs/issues/254
)
- fix up one use of qsa, hit when filling forms with missing elements
2012-10-01, v1.0.0-RC2
...
...
bin/bootstrap.js
View file @
f92de3f
...
...
@@ -278,6 +278,7 @@ function bootstrap(global) {
phantom
.
casperArgs
.
drop
(
"test"
);
}
else
if
(
phantom
.
casperArgs
.
get
(
0
)
===
"selftest"
)
{
phantom
.
casperScript
=
fs
.
absolute
(
fs
.
pathJoin
(
phantom
.
casperPath
,
'tests'
,
'run.js'
));
phantom
.
casperSelfTest
=
true
;
phantom
.
casperArgs
.
options
.
includes
=
fs
.
pathJoin
(
phantom
.
casperPath
,
'tests'
,
'selftest.js'
);
if
(
phantom
.
casperArgs
.
args
.
length
>
1
)
{
// we want a single test file
...
...
tests/run.js
View file @
f92de3f
...
...
@@ -14,6 +14,19 @@ var casper = require('casper').create({
});
// local utils
function
checkSelfTest
(
tests
)
{
var
isCasperTest
=
false
;
tests
.
forEach
(
function
(
test
)
{
var
testDir
=
fs
.
absolute
(
fs
.
dirname
(
test
));
if
(
fs
.
isDirectory
(
testDir
))
{
if
(
fs
.
exists
(
fs
.
pathJoin
(
testDir
,
'.casper'
)))
{
isCasperTest
=
true
;
}
}
});
return
isCasperTest
;
}
function
checkIncludeFile
(
include
)
{
var
absInclude
=
fs
.
absolute
(
include
.
trim
());
if
(
!
fs
.
exists
(
absInclude
))
{
...
...
@@ -54,6 +67,12 @@ if (casper.cli.args.length) {
casper
.
exit
(
1
);
}
// check for casper selftests
if
(
!
phantom
.
casperSelfTest
&&
checkSelfTest
(
tests
))
{
casper
.
warn
(
'To run casper self tests, use the `selftest` command.'
);
casper
.
exit
(
1
);
}
// includes handling
this
.
loadIncludes
.
forEach
(
function
(
include
){
var
container
;
...
...
Please
register
or
sign in
to post a comment