Nightwatch.js File Upload With Dropzone.js
I am trying to upload a pdf file on our file upload using nightwatch.js but the thing is there are no input type='file' on our upload. The html looks like this:
Solution 2:
You can make it visible like this >
client.execute(function(data){
document.querySelector('input[type="file"]').className="";
}, [], function(result){
console.log(result);
});
after this you can set your value for upload.
Solution 3:
as of Dropzone v3.12.0 (note: the newest version is v5.4.0)
You can do this in nigthwatch.js to upload a file.
browser
.execute(`
// this makes the DropZone hidden input, visible
document.querySelector('input[type="file"]').style.visibility = "visible";
`)
.setValue('input.dz-hidden-input', AbsolutePathToFile)
Post a Comment for "Nightwatch.js File Upload With Dropzone.js"