phantasma
phantasma copied to clipboard
There is no .upload() method like Nightmare has
Will make some user cases and tests when I have time for my commit.
No need to close the issue it's entirely valid. Did you get anywhere on your PR?
This is my version:
Phantasma.prototype.upload = function (selector, path) {
var self = this;
return new this.promise(function (resolve, reject) {
self.page.uploadFile(selector, path);
resolve();
})
}
But It doesn't seem to work. Any chance you guys make a better version?
Version 2 (still doesn't work)
Phantasma.prototype.upload = function (selector, path) {
var self = this;
return new this.promise(function (resolve, reject) {
if (fs.existsSync(path)) {
self.page.uploadFile(selector, path);
console.log(path);
resolve();
} else {
console.log("Didn't upload")
}
});
}
Apparently it's phantomjs 2.0 fault. The fix is here : https://github.com/skakri/phantomjs/releases/tag/2.0.1-regression-12506 . Updating phantomjs to 2.0.1 will fix the bug and make the upload method work. So, my questions is: Do we implement the method and update the framework or will just w8 until 2.1 comes out?
Sounds fine to put in but to just add a note in the documentation that it won't work if not using 2.0.1
Was this fixed in the 2.1 phantomjs version? Can we integrate the .upload() function now?