One difficulty testers run into when they are new to driving browsers with cucumber is knowing how to handle sites that contain a lot of ajax calls. They write scripts that assume the elements on the page exist and are shocked when the tests fails because it was trying to access something that wasn’t on the page yet.
In this post I’ll write a simple scenario that demos the async handling capabilities in the page-object gem. I’ll also briefly introduce you to a new gem that I use to generate my new projects. I’ll do all of this by writing a scenario that uses one of the examples google has provided to demo the GWT libraries. For those of you who have taken one of my classes you will already be familiar with this example but perhaps there are still a few things here for you to learn. Let’s get started writing the code!