These are chat archives for rosshinkley/nightmare

15th
Apr 2016
James Causon
@xCausxn
Apr 15 2016 19:46
Evening all
Ross Hinkley
@rosshinkley
Apr 15 2016 19:46
greetings
James Causon
@xCausxn
Apr 15 2016 19:47
Loving nightmare, but its giving me a small nightmare at the moment :P
Ross Hinkley
@rosshinkley
Apr 15 2016 19:48
ha, what's up?
James Causon
@xCausxn
Apr 15 2016 19:48
.type('#input_1', 'xCausxn')
    .type('#input_2', 'test')
for some reason types in the same input box
which is #input_1
Ross Hinkley
@rosshinkley
Apr 15 2016 19:49
two questions... is there an #input_2?
aaaand.. if so, if you stick a .wait() between the .type() calls, what happens?
James Causon
@xCausxn
Apr 15 2016 19:50
yes there definetly is
I also used the direct selector paths
Will test wait again now
Ross Hinkley
@rosshinkley
Apr 15 2016 19:52
I also wonder if you're hitting segmentio/nightmare#485 from a different angle
(which is why i asked about a wait between the two calls)
James Causon
@xCausxn
Apr 15 2016 19:52
Ok so
adding wait made the second not get inputted but
if you click manually on the second field it starts inputting
but doesnt focus automatically
if it helps the site is powered by angular but that just background info
:P
hmmm ok it happend again but I think it might be the naming of the selector
Ross Hinkley
@rosshinkley
Apr 15 2016 19:55
yeah, first suggestion is double-check your selectors
James Causon
@xCausxn
Apr 15 2016 19:55

input_1 and #input_2 type in the same input

Ross Hinkley
@rosshinkley
Apr 15 2016 19:55
second... the comment about angular rings a bell
James Causon
@xCausxn
Apr 15 2016 19:55
sorry xD
rosshinkley @rosshinkley chuckles
James Causon
@xCausxn
Apr 15 2016 19:56
if i use '[type="password"]'
I have to manually click the element then it starts typing the pass
Ross Hinkley
@rosshinkley
Apr 15 2016 19:56
that makes it almost sound like the .focus() call isn't being honored
ah jeez, i thought segmentio/nightmare#548 had been accepted
I think you're hitting segmentio/nightmare#222, possibly? That's where i first saw the angular comment that the events aren't bubbling properly
but 548 forces focus/blur
for both .insert() and .type()
.... out of curiosity, what happens if you use .insert() on your #input_2 selector?
James Causon
@xCausxn
Apr 15 2016 20:00
same thing
Ross Hinkley
@rosshinkley
Apr 15 2016 20:03
now that is curious
if you open up your project from a regular chrome instance and open the devtools, can you execute the .focus() call from there and have it work right?
make a call from console like... document.querySelector('#input_2').focus()
James Causon
@xCausxn
Apr 15 2016 20:08
Uncaught TypeError: Cannot read property 'focus' of null(…)
for both #input
Wait I think I found something with this site
2 secs
Ross Hinkley
@rosshinkley
Apr 15 2016 20:10
your selector is probably wrong, then
James Causon
@xCausxn
Apr 15 2016 20:10
Yeah it is now haha
Ross Hinkley
@rosshinkley
Apr 15 2016 20:10
might want to right click-> inspect and look at the id
James Causon
@xCausxn
Apr 15 2016 20:10
My collegue deployed without telling me
Ross Hinkley
@rosshinkley
Apr 15 2016 20:10
hahaha
... it's not funny :|
James Causon
@xCausxn
Apr 15 2016 20:10
Its annoying, however the inputting in the same element is wierd
sorry for wasting your time
Ross Hinkley
@rosshinkley
Apr 15 2016 20:11
oh, don't worry
you might have uncovered a legitimate problem
James Causon
@xCausxn
Apr 15 2016 20:12
might :P
Ross Hinkley
@rosshinkley
Apr 15 2016 20:12
if you type into an existing selector, then try typing into a nonexisting selector, the second call shouldn't happen
instead, based on what you've told me, it sounds like the events for the second input just get piped to whatever happened to have been focused last
and that would be "bad"
i'll add that to my list of things to check out
James Causon
@xCausxn
Apr 15 2016 20:14
Yeah
That sounds like it