These are chat archives for rosshinkley/nightmare

10th
May 2016
Rick Medina
@rickmed
May 10 2016 00:35
hello! quick question: I see that nightmare disables dialogs by default? why? how can overwrite it?
Rob Brackett
@Mr0grog
May 10 2016 01:36
I don’t believe there’s any reasonably sane way to stop what Nightmare is doing
One of the issues there is that dialogs block everything else—no other commands can be sent while a dialog is open
I can imagine a situation where there’d be an API for responding to confirm and prompt dialogs, but it certainly doesn’t exist now
you can get them as events if you just need to know that they were shown and what the dialog said
Rob Brackett
@Mr0grog
May 10 2016 01:42
e.g:
nightmare
  .on('page-alert', function(message) { console.log('Alerted:', message); })
  .goto('http://some-page.com/with-an-alert.html')
  .then(function() { ... });
page-alert, page-prompt, page-confirm for the various dialogs
Rick Medina
@rickmed
May 10 2016 01:59
@Mr0grog I did some research and there is a way to interact on dialog opened but dialogs are not opened from content loaded from an iframe or webview (not supported yet by electron) which is my case so nothing to do about it...
thanks for the response
Rob Brackett
@Mr0grog
May 10 2016 02:17
ah, yeah, iframes can be their own set of complications
Ross Hinkley
@rosshinkley
May 10 2016 15:37
i know I'm late to the party @rickmed and @Mr0grog, but you can override the default behavior for dialogs by defining a custom preload, but there isn't a great way to handle dialogs at runtime
(which i think is what @Mr0grog might have been talking about)
that may be a good future improvement
as for segmentio/nightmare#502 - i got most of the way down the path of separating X and dbus out, running one instance of each
Ross Hinkley
@rosshinkley
May 10 2016 15:42
running all of the processes in isolation solves a couple of problems
and it works - at least insofar as the processes spinning up when they are supposed to and running
the biggest problem i've had is ending them appropriately
and also making sure they are actually ended when Nightmare exits
... unfortunately, i've had some other responsibilities crop up and haven't had as much time as i'd like to spend on the problem
all of that said, i don't think separating the processes out like that for all instances including tests was a bad plan
i'm on board for the Just Work™ plan
Ross Hinkley
@rosshinkley
May 10 2016 15:49
i've also done some experimentation to make sure this will work with existing X instances, so it shouldn't step too hard on existing solutions in segmentio/nightmare#224
i'd like to give it a try under docker
that may be a later-this-week project, though
Rob Brackett
@Mr0grog
May 10 2016 16:19

i'm on board for the Just Work™ plan

Oh, I still like that plan :D
I was just thinking it might be better to solve the “stop using make” problem first rather than try and go all the way in one. BUT if you’re pretty much there, ¯\_(ツ)_/¯

Ross Hinkley
@rosshinkley
May 10 2016 16:25
:)
yeah, hindsight being what it is
i probably should have solved that problem first
but i got a case of the "might as well"s