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
c8971d57
...
c8971d57d7664ab690936a35607ec092d3b49845
authored
2013-10-10 00:28:32 +0200
by
Mickaël Andrieu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
REFS #665 - Added a backward compatibility for "--direct" option
1 parent
9b5f9255
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
docs/cli.rst
docs/testing.rst
modules/casper.js
docs/cli.rst
View file @
c8971d5
...
...
@@ -91,11 +91,16 @@ Execution results:
The `casperjs` command has three available options:
- ``--
verbose
``: to prints out log messages to the console
- ``--
direct
``: to prints out log messages to the console
- ``--log-level=[debug|info|warning|error]`` to set the :ref:`logging level <logging>`
- ``--engine=[phantomjs|slimerjs]`` to select the browser engine you want to use. CasperJS
supports PhantomJS (default) that runs Webkit, and SlimerJS that runs Gecko.
.. warning::
.. deprecated:: 1.1
``--direct`` option now become ``--verbose``
Example:
.. code-block:: text
...
...
docs/testing.rst
View file @
c8971d5
...
...
@@ -157,7 +157,7 @@ Options
Options are prefixed with a double-dash (``--``):
- ``--xunit=<filename>`` will export test suite results in a :ref:`XUnit XML file <xunit_report>`
- ``--
verbose
`` will print :doc:`log messages <logging>` directly to the console
- ``--
direct
`` will print :doc:`log messages <logging>` directly to the console
- ``--log-level=<logLevel>`` sets the logging level (see the :doc:`related section <logging>`)
.. versionadded:: 1.0
...
...
@@ -176,11 +176,16 @@ Sample custom command:
$ casperjs test --includes=foo.js,bar.js \
--pre=pre-test.js \
--post=post-test.js \
--
verbose
\
--
direct
\
--log-level=debug \
--fail-fast \
test1.js test2.js /path/to/some/test/dir
.. warning::
.. deprecated:: 1.1
``--direct`` option now become ``--verbose``
.. hint::
A `demo gist <https://gist.github.com/3813361>`_ is also available in order to get you started with a sample suite involving some of these options.
...
...
modules/casper.js
View file @
c8971d5
...
...
@@ -129,7 +129,7 @@ var Casper = function Casper(options) {
// factories
this
.
cli
=
phantom
.
casperArgs
;
this
.
options
.
logLevel
=
this
.
cli
.
get
(
'log-level'
,
this
.
options
.
logLevel
);
this
.
options
.
verbose
=
this
.
cli
.
has
(
'verbose'
);
this
.
options
.
verbose
=
this
.
cli
.
has
(
'
direct'
)
||
this
.
cli
.
has
(
'
verbose'
);
this
.
colorizer
=
this
.
getColorizer
();
this
.
mouse
=
mouse
.
create
(
this
);
this
.
popups
=
pagestack
.
create
();
...
...
@@ -208,6 +208,11 @@ var Casper = function Casper(options) {
// dispatching an event when instance has been constructed
this
.
emit
(
'init'
);
// deprecated direct option
if
(
this
.
cli
.
has
(
'direct'
))
{
this
.
emit
(
"deprecated"
,
"--direct option has been deprecated since 1.1; you should use --verbose instead."
)
}
};
// Casper class is an EventEmitter
...
...
Please
register
or
sign in
to post a comment