Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 519 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 519 Bytes

nightmare-upload

Adds files to form using debugger

Usage

Require the library:

require('nightmare-upload')

then use .upload(selector, path) action

.upload(selector, path)

Adds file to selector input.

Example

require('nightmare-upload');

var nightmare = Nightmare();
yield nightmare
  .upload('#single-file-input', path.join(__dirname, '1.txt'))
  .evaluate(function () {
    return document.querySelector('#single-file-input').files.length;
  });