Posts

Showing posts from March, 2015

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 effectively on the GitHub page f…

Angular + Protractor + Sauce Connect, launched from Gulp, all behind a corporate firewall!

Image
You didn't think it could be done, did you?
Well, let me prove you wrong!  First, some terms: AngularJS: An MVC framework for JavaScript, allowing you to write web apps without relying on JQuery.Protractor: A test harness for Angular apps.Sauce Labs: A company providing cloud services to help you run E2E testing on your web app in any environment combination.Node.js: Package manager for JavaScript.  You'll need this for installing all the dependencies to get this tool set working.Gulp: A build manager and mundane-task automator.  Competitor with the older, well-entrenched Grunt, but gaining popularity by the hour.  Uses JavaScript syntax, but could theoretically be used as a Makefile or shell script replacement.
The Basic Premise
My organization is writing web apps using Angular.  Long before I joined, they selected Gulp to manage application tasks such as allowing it to run on localhost at port 8888 for development & unit test purposes.  They also selected Protractor as a tes…