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
837a0bcb
...
837a0bcb770ca38f4eb260b0c70b436999f9301d
authored
2011-10-11 08:15:55 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added a check for Casper#fill 'selector' argument
1 parent
de1a0348
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
casper.js
casper.js
View file @
837a0bc
...
...
@@ -309,6 +309,9 @@
* @param Boolean submit Submit the form?
*/
fill
:
function
(
selector
,
vals
,
submit
)
{
if
(
typeof
(
selector
)
!==
"string"
)
{
throw
"selector must be a string: "
+
selector
;
}
if
(
!
typeof
(
vals
)
===
"object"
)
{
throw
"form values must be an object"
;
}
...
...
@@ -331,7 +334,7 @@
})(
this
);
}
// Form submission?
if
(
submit
===
true
)
{
if
(
(
submit
||
false
)
===
true
)
{
this
.
evaluate
(
function
()
{
var
form
=
document
.
querySelector
(
'%selector%'
);
console
.
log
(
'submitting form to '
+
(
form
.
getAttribute
(
'action'
)
||
"unknown"
)
...
...
Please
register
or
sign in
to post a comment