These are chat archives for rosshinkley/nightmare

1st
Jun 2016
James Tindall
@atomless
Jun 01 2016 11:05
Does anyone know if calling click twice triggers a double click or if there's another way to trigger a double click with nightmare?
James Tindall
@atomless
Jun 01 2016 12:02
doesn't seem to
Nadeem
@nadyshaikh
Jun 01 2016 13:53

Hello Guys

I am new on nightmare. I am trying to get evaluate return value in run to insert in database

Nadeem
@nadyshaikh
Jun 01 2016 14:04
how to run mysql insert query from evaluate function or run function
Ross Hinkley
@rosshinkley
Jun 01 2016 15:05
@atomless no, i don't think .click() was designed to do that, you'd have to write your own event wiring to send dblclick
you may also want to try using nightmare-real-mouse calling .realClick() twice - it calls webContents.sendInputEvent() which might do what you're after, i'm not sure
This message was deleted
oops
Ross Hinkley
@rosshinkley
Jun 01 2016 15:11
@nadyshaikh something like....
nightmare
  .goto(someUrl)
  .evaluate(() => {
    //... do some actions on the site...
    return someResult;
  })
  .then((someResult) => {
    //write someResult into your mySQL database
  })
Ross Hinkley
@rosshinkley
Jun 01 2016 15:23
@nadyshaikh I'd need a more complete example to be of more help
Rob Brackett
@Mr0grog
Jun 01 2016 17:11

@atomless --

you may also want to try using nightmare-real-mouse calling .realClick() twice - it calls webContents.sendInputEvent() which might do what you're after, i'm not sure

Yes, real-click will do a proper double click if you call it twice within 300ms

(on the same position)
actually that timing should probably be much longer
but anyway

if you

nightmare
  .goto(somewhere)
  .realClick('.some-button')
  .realClick('.some-button')

You'll get a double-click.

Ross Hinkley
@rosshinkley
Jun 01 2016 17:25
@Mr0grog good to know for sure
thanks :)
James Tindall
@atomless
Jun 01 2016 19:08
@Mr0grog Thanks! - yes I found the nightmare-real-mouse and it works a treat!