Functional Testing with Watir: 7 minutes

Good title, good intention, lots of work in implementation. The idea is that I don’t find a lot of time to dedicate to writing blog posts on my testing work, approach and so on so how bout my taking 3 minutes to just write, or 5 minutes or 7 minutes to write a bit. With time I may get good at it.

Most of my time these days is spent Functional Testing. Writing and executing Browser Tests with Watir gem. I have been trying to adapt TDD approach to GUI tests but it’s not working, I end up wiring my own UseCase modules and scenarios and runners. I see that ‘cucumber’ may be a way to do some of those tests but we’ll see.

So far I can say that tools like test/unit, test/spec, rspec, shoulda, woulda, coulda, wanna do da do not support this type of GUI sequential workflow tests. I guess these are the tests that Brian Marick calls Business-facing tests, and Workflow Tests.

Basically GUI Browser Tests are tedious because you deal with DOM as implemented by developers who just want to ship the data over to the browser and make it look decent. Most of the DOM ends up being presentation layer wrapper on data elements and I need Semantic Structure of the page for my tests. So I end up writing a Semantic View Layer on top of the DOM. Then I write a Model View of the Domain I am testing and mash the two in my Test Controllers. I view this as Quick MVC framework for Watir, splish-splay and flush, and I call it Watirloo.

More about this later.

Post a Comment

You must be logged in to post a comment.