Commit 1456d23e 1456d23e1df2bac003792760c33362f2eb9c48c2 by Nicolas Perriault

fixed #389 - check that uploaded file path exists

1 parent 41d61fdb
......@@ -731,6 +731,9 @@ Casper.prototype.fill = function fill(selector, vals, submit) {
} else {
(function _each(self) {
fillResults.files.forEach(function _forEach(file) {
if (!fs.exists(file.path)) {
throw new CasperError('Cannot upload unexistent file: ' + file.path);
}
var fileFieldSelector = [selector, 'input[name="' + file.name + '"]'].join(' ');
self.page.uploadFile(fileFieldSelector, file.path);
});
......