Automated tests 如何使用Nightwatch将图像上载到输入字段(当前仅上载文本)?

Automated tests 如何使用Nightwatch将图像上载到输入字段(当前仅上载文本)?,automated-tests,nightwatch.js,Automated Tests,Nightwatch.js,如何使用Nightwatch将图像上载到输入字段? 我目前正在使用设置键,其中夜间监视代码如下所示: require('path').resolve(__dirname + '/nightwatch.jpg') 但是,这会导致上传文本nightwatch.jpg 这是输入字段的外观: <input id="cc_action_image_upload" ng-show="true" class="btn btn-default btn-file ng-dirty ng-invalid

如何使用Nightwatch将图像上载到输入字段? 我目前正在使用设置键,其中夜间监视代码如下所示:

require('path').resolve(__dirname + '/nightwatch.jpg')
但是,这会导致上传文本nightwatch.jpg

这是输入字段的外观:

<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);”>

啊!!路径上的小错误。我忘了在路径之前添加./