Wait until document ready

1,206 views
Skip to first unread message

Arpad Cseh

unread,
Apr 18, 2016, 5:16:48 AM4/18/16
to NightwatchJs
Hi all!

I'm working with a web page testers team and I occasionally review their code (I'm a FE developer). I have seen that they use browser.waitForElementVisible('body') in order to ensure page load. Which (as far as I see) is polling based, would be possible to implement a document ready event listener/callback based solution for that? Or maybe there are some known methods to perform the same result? I think it would give us much better and safer test cases, what do you think?
( I'm relativelly new in nightwatch js world but I can read the source code :) )


Take care,
Arpad

Dan Caseley

unread,
Apr 18, 2016, 10:26:26 AM4/18/16
to NightwatchJs
Isn't this an implementation for a very special case? Or are you advocating special listeners for waitForElementVisible / waitForElementPresent calls?
I don't usually wait for body - usually I'm waiting for something else that's been loaded asynchronously from a second JS call on the page, or some other thing happening in the ways of RIA rather than the static web.

HTH, although I doubt it...

Dan
Reply all
Reply to author
Forward
0 new messages