Posted on Monday, 04 February 2008
In my last post I gave a glimpse into our new WatiN stack, another feature is that we have implemented the command pattern, and serialise the commands out as XML. This lets us build tests that have randomised execution and still replay them when they fail. As a nice by-product, we also can write tests as XML if we wish.
For example the following XML:
<?xml version="1.0"?>
<ArrayOfAnyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<anyType xsi:type="TestExecutionCommand">
<MethodName>Search</MethodName>
<AssemblyName>SearchTests.Logical, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</AssemblyName>
<ClassName>SearchTests.Logical.SearchModel</ClassName>
<Parameters>
<anyType xsi:type="DataProvider">
<DataIdentifier>SearchForWatin</DataIdentifier>
</anyType>
</Parameters>
</anyType>
</ArrayOfAnyType>
will execute the same test as before. Building a tool to generate this would be completely trivial, should we choose to go down that route.