Monday, January 4, 2010

WPF MeTL Implementation Notes

Well, crazy to expect anyone but my internal team to ever read this so I'm going to to start to put notes down on project specific stuff, expecting that it might be useful to someone who's going mad and running Google searches until their elbows bleed.

Here's a doozy:

We're running UIAutomation testing over our app now, since there are only seven weeks to go and I'm keen to have a high level functional test verifying basic functionality as we patch and tweak.

We had to build entirely custom ink injection, as that's not one of the supported patterns. Apparently in Windows 7 beta (why is this tied to an OS btw?) you can define custom patterns but I couldn't find any information about how to do it and ended up hijacking the value pattern - it's got get/set semantics over a string so it's not a huge problem. In fact, it's a huge advantage because it pushed me into realising that we could use the same messaging structure into and out of the automation framework as we use into and out of the server.

Reuse as much of the existing parse structure as you can, of course.

What's the doozy? ItemsControl does not expose a default AutomationPeer, but ListBox does. I've gotten so used to these two things in particular being only slightly different from each other that it completely took me by surprise. This, I think, is my major criticism of the Automation stuff, and it's really not their fault - a new dev on my project will change x:Names, or remove them because they're never referenced. This will build, compile and deploy but it will break the tests that can read them as implicit AutomationId declarations.