如何使用Nightwatch将图像上传到输入字段(目前仅上传文字)?

时间:2015-09-08 14:19:05

标签: automated-tests nightwatch.js

如何使用Nightwatch将图像上传到输入字段? 我目前正在使用setKeys(),其中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);”>

0 个答案:

没有答案