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
f1502845
...
f15028450f23a97cab2133b811f98f53bd520e01
authored
2011-11-23 22:24:15 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added Casper#createStep for easily create step functions with options
1 parent
061a8f8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
casper.js
casper.js
View file @
f150284
...
...
@@ -228,6 +228,18 @@
},
/**
* Creates a step definition.
*
* @param Function fn The step function to call
* @param Object options Step options
* @return Function The final step function
*/
createStep
:
function
(
fn
,
options
)
{
fn
.
options
=
isType
(
options
,
"object"
)
?
options
:
{};
return
fn
;
},
/**
* Logs the HTML code of the current page.
*
* @return Casper
...
...
@@ -748,13 +760,11 @@
* @see Casper#open
*/
thenOpen
:
function
(
location
,
then
)
{
var
step
=
function
(
self
)
{
this
.
then
(
this
.
createStep
(
function
(
self
)
{
self
.
open
(
location
);
};
step
.
options
=
{
},
{
skipLog
:
true
};
this
.
then
(
step
);
}));
return
isType
(
then
,
"function"
)
?
this
.
then
(
then
)
:
this
;
},
...
...
Please
register
or
sign in
to post a comment