CasperJS test lazyload

As you know,  CasperJS/PhantomJS is perfect for automation test in client-side. And nowaday, you usually develop lazyload function that means when you pull the scroll of window or element (div html tag) to the bottom of page, the page will automatically load more data and bind it to the view (table or grid). Along with it, we need write unit test function to cover fully user experiences.

CasperJS test lazyload

Life is what we make it, always has been, always will be

With PhantomJS/CasperJS, It is quite easy, just take a look to the source code below. You just need 2 main functions of CasperJS is scrollToBottom and waitFor to implement it.

 

ShareShare on FacebookShare on LinkedInShare on Google+Tweet about this on TwitterEmail this to someoneShare on Tumblr