How can I upload an image to an input field using Nightwatch?
I am currently using setKeys()
where the Nightwatch code looks like:
require('path').resolve(__dirname + '/nightwatch.jpg')
However, this results in uploading the text "nightwatch.jpg"
This is what the input field looks like:
<input id="cc_action_image_upload" ng-show="true"
class="btn btn-default btn-file ng-dirty ng-invalid ng-invalid-required next-value"
ng-class="{'next-value': !nextValid.value || !nextValid.tab2}" type="file"
ng-file select="onFileSelect($files, 'action_images/', 'action_creative.image')"
ng-model="uploadFields.actionImage" accept="image/*" name="ls_action_image"
shown-validation="" valid-file="" required="" style="background-color: rgb(255, 255, 255);”>