4 ms·
Internally here at Guidewire, we have a declarative widget-based web framework for our apps, and we test by automatically generating a Page Object model based o
by akeefer 15y ago
Internally here at Guidewire, we have a declarative widget-based web framework for our apps, and we test by automatically generating a Page Object model based on the declarative widget definitions (using metaprogramming techniques in Gosu). The rigidness of defining your application in terms of declarative widgets is not for most applications, but the resulting improvement in testability is probably the biggest benefit. Separating out a logical model of "widgets" on the page and writing against a Page Object model, whether or not your web framework has widgets, is clearly the right way forward to me. There's nothing worse than debugging hundreds of test failures because no DOM element with id "User_Search" was found on the page. Did the page not render? Did the test run too fast? Did someone change the ID? Did someone move the search button to a different page? Did they hide it behind some div I need to expand first? Did the page just break? There goes two days of development time . . .
Prior to that approach, we tried everything: we actually wrote our own test framework that used javascript to drive the browser from inside the browser, then we moved to using selenium, but they all suffered from that same problem of incredibly fragile tests. Over time, test maintenance is easily 10x the cost of initial test development, so it's a huge, huge problem.
So I see this as a promising direction, but building and maintaining that (essentially) Page Object model by hand is going to result in its own set of maintenance problems. How do you know when the model is up to date? If someone changes the model, how do you know which test that affects if you're in a dynamic language like Ruby? It solves one set of horrific problems, and replaces it with another set of problems that are hopefully, with enough developer discipline applied (and guidance from the framework), ultimately slightly less horrific. Being able to automatically generate the POM via metaprogramming by statically analyzing your application is awesome, but it's not a technique that really works with any standard web framework that I know of.
Web app testing really still has a long, long, long way to go.
- sgrove 15y agoThere are some awesome strides about to made for generating/maintaining POM (or WOM, in our case) - sadly, marketing has shot down all of my suggested names :( That said, it's going to be a lot of fun, and I'd love to have someone with your experience and insight join in the conversation. I'll have to think of a way to do it - a Test::Right convore, or mailing list, perhaps?
- akeefer 15y agoMy personal e-mail is in my profile, so I'm happy to participate in whatever manner you deem is best. Just send me an e-mail and let me know (or if you're in the Bay Area, you can catch me in person at SuperHappyDevHouse on Saturday).