Commit 837a0bcb 837a0bcb770ca38f4eb260b0c70b436999f9301d by Nicolas Perriault

added a check for Casper#fill 'selector' argument

1 parent de1a0348
......@@ -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")
......