Does Protractor + Selenium WebDriver Sound "Promising?"
I have been diving into JavaScript and AngularJS heavily over the past few weeks, pushing the capabilities of my organization's application testing in the process. Despite having written quite a bit of JavaScript in my past for a number of award-winning Web applications (in hackathons), some of the latest trends in that language had bypassed me completely. In coming up to speed on JavaScript Promises, here is some code that has proven very useful in my activities. Typically, doing Web page testing requires interacting with the user interface, then waiting for something to happen (you logged in, paid your bill, ordered food, wrote a review, etc.). There are three ways to wait for such UI interactions to complete in JavaScript: Pure asynchronous callbacks (nested and ugly) Unchained promises (still can be nested, and has potential to get ugly) Chained promises (Pretty straightforward) The essence of these three methodologies is described succinctly and effectiv...