segment-boneyard / nightmare

A high-level browser automation library.
https://open.segment.com
19.55k stars 1.08k forks source link

Enter a File to a File Input #886

Closed zatziky closed 7 years ago

zatziky commented 8 years ago

With nightmarejs how to enter a file in a file input and confirm it?

It's for automation of an attachment (e.g. in email). The file input I mean is this:

enter image description here

jekku commented 8 years ago

Up for this. This is important in testing websites. Unless there could be alternatives using native electron, or if nightmare exposes electron.dialog().

rosshinkley commented 8 years ago

File uploads are not natively supported under Nightmare (or Electron for that matter). You can do uploads by using the debugger API, which is what nightmare-upload does. Does that plugin work for you?

rodrigoruiz commented 6 years ago

The plugin doesn't work inside an iframe: https://github.com/rosshinkley/nightmare-upload/issues/9

ghost commented 6 years ago

The nightmare-upload plugin not work with the 3.0... this feature should be included in nightmarejs directy.