These are chat archives for rosshinkley/nightmare

16th
Apr 2016
Rob Brackett
@Mr0grog
Apr 16 2016 00:19
At least part of the problem there is that type doesn’t bother to fail if nothing matching the selector was found: https://github.com/segmentio/nightmare/blob/master/lib/actions.js#L148
So things could at least be improved a little if the callback that does the actual typing there (after focusing) bailed with an error if the focusing script failed.
Ross Hinkley
@rosshinkley
Apr 16 2016 02:47
@Mr0grog I figured that was the case, but it wasn't until @xCausxn had the problem it hit home
thanks for doing the legwork :)
segmentio/nightmare#577 has been created for reference
Ross Hinkley
@rosshinkley
Apr 16 2016 16:07
eesh. that devtools crash :|
Rob Brackett
@Mr0grog
Apr 16 2016 17:12
Oh yeah
real pain to track down, too. Incredibly non-obvious.
Ross Hinkley
@rosshinkley
Apr 16 2016 17:27
i don't doubt it
Ross Hinkley
@rosshinkley
Apr 16 2016 17:35
i suppose i should make good on my promise and cut the .goto() pr you have, eh?
i got way sidetracked last night with segmentio/nightmare#375
Rob Brackett
@Mr0grog
Apr 16 2016 17:36
ah, no worries
oh
speaking of #375
Don't know if you saw electron/electron#5183
WebContents delegates to the WebFrame in the renderer process and its mechanism for doing is buggy
So that bug needs to be fixed, but Nightmare could work around it by just calling WebFrame’s executeJavaScript instead
Ross Hinkley
@rosshinkley
Apr 16 2016 17:37
i should subscribe to electron and filter to your username :P
Rob Brackett
@Mr0grog
Apr 16 2016 17:37
hahahaha
Ross Hinkley
@rosshinkley
Apr 16 2016 17:37
i hadn't seen that yet
rosshinkley @rosshinkley reads
Rob Brackett
@Mr0grog
Apr 16 2016 17:38
Not very pretty, but works
Ross Hinkley
@rosshinkley
Apr 16 2016 17:39
ahhhhhh, i had seen the line in web-contents you referenced and wondered if that had something to do with it
but had gone down the dark rabbithole of trying to figure out the backing internals to those calls to asyncWebFrameMethods
Rob Brackett
@Mr0grog
Apr 16 2016 17:40
It didn’t occur to me that isLoading() would cover subframes, too
I imagine whoever wrote that line was thinking the same way
Ross Hinkley
@rosshinkley
Apr 16 2016 17:40
i wouldn't have thought that either, yeah
what's odd is i set up a test case very similar to yours
Rob Brackett
@Mr0grog
Apr 16 2016 17:41
oh
Ross Hinkley
@rosshinkley
Apr 16 2016 17:41
and it "worked"
... might have to go have another look at that
Rob Brackett
@Mr0grog
Apr 16 2016 17:42
it’s all about timing, so easy to get wrong, I think
Ross Hinkley
@rosshinkley
Apr 16 2016 17:42
yeah, off the top of my head, i can't remember if i was using local resources or not
which would change timing dramatically
Rob Brackett
@Mr0grog
Apr 16 2016 17:42
yeah
Ross Hinkley
@rosshinkley
Apr 16 2016 17:42
i think i was
Rob Brackett
@Mr0grog
Apr 16 2016 17:43
my original example had a little HTTP server that just sat for 1000ms before responding
:D
Ross Hinkley
@rosshinkley
Apr 16 2016 17:43
but i had written a (terrible) service with Express that emulated delays
Rob Brackett
@Mr0grog
Apr 16 2016 17:43
hahahahaha
Ross Hinkley
@rosshinkley
Apr 16 2016 17:43
lol
Rob Brackett
@Mr0grog
Apr 16 2016 17:43
saaaame thing
Ross Hinkley
@rosshinkley
Apr 16 2016 17:43
great minds, all that
;)
that makes me wonder if i either 1) didn't delay long enough (seems unlikely)
2) did something goofy with the iframe
Rob Brackett
@Mr0grog
Apr 16 2016 17:44
¯_(ツ)_/¯
Ross Hinkley
@rosshinkley
Apr 16 2016 17:44
eh, i'll take a look in a minute
good to know my initial instinct was pretty spot-on
just sucks that my execution was terrible :P
at any rate!
Rob Brackett
@Mr0grog
Apr 16 2016 17:45
ah, well
mystery solved, at least
Ross Hinkley
@rosshinkley
Apr 16 2016 17:46
that does make me feel marginally better
Ross Hinkley
@rosshinkley
Apr 16 2016 17:51
augh, i see what i did wrong
be sure to check your spelling, kids
well!
now that i feel like a total doofus, what's next?
Rob Brackett
@Mr0grog
Apr 16 2016 18:00
ha, that's just the life of programming
anyway, I'm off to enjoy Saturday
later
Ross Hinkley
@rosshinkley
Apr 16 2016 18:00
have a good one :)