These are chat archives for rosshinkley/nightmare

1st
Mar 2017
Alexander Tsepkov
@atsepkov
Mar 01 2017 23:48
hi guys, what's the best way of dealing with links that redirect the page (and then having that other page take a couple seconds to load)? It seems like the only consistent way I found it to work is to use generous .wait(ms), which seems like a hack to me. .wait(selector) sometimes fails to detect that selector loaded, .on('dom-ready') often seems to fire prematurely (maybe it looks at dom of previous page before the new one loads?), likewise, I tried the wrapper explained in segmentio/nightmare#481 and it too seems to fire prematurely or not at all. .ewait('dom-ready') fails more often than not, whereas .wait(2000) works consistently.
Alexander Tsepkov
@atsepkov
Mar 01 2017 23:54
I'm guessing a lot of these things fail because they attempt to run on the old page instead of the new one, is there something like .newPage() for commands I'm missing or are the tests mostly designed to stay on a single page?