I've a new requirement within my nightwatchjs test script where I need to upload a file within a typical 'Drag or click her to upload' field.
I've not done an upload test before, so I'm after some help please.
Below is the html for the field where the files are uploaded too, when manually testing this function;
So, in my nightwatchjs script I currently have the following (taken from an answer given in a previous post here ;
const path = require('path');
module.exports = {
.....
browser.setValue('input.dz-hidden-input', path.resolve('/path to jpeg/filename.jpeg'));
but this doesn't appear to work.
It doesn't fail as such (i.e. there are no error messages, and the test doesn't stop), but the file is not uploaded.
I thought I might be referencing the wrong element, so I also tried replacing the element input.dz-hidden-input part of the command with;
- div#uploadPanel.dropzone.ember-view.dz-clickable
- div#uploadPanel.dropzone
- .dropzone.ember-view.dz-clickable
- .dropzone
but with no luck.
Am I missing something obvious with this test, or is this upload functionality way, way more complicated in nightwatchjs than a simple setvalue command?
Any help would be greatly appreciated.