maandag 26 oktober 2009

WatiN and MbUnit, a nice combo

Just a shameless repost of a mail Jeff Brown did send to the WatiN mailinglists. Interesting stuff, go check it out!

ANN: New samples for using WatiN with MbUnit.

I just released Gallio / MbUnit v3.1 Update 1.

It's mainly a bug fix release but I also added some new samples
demonstrating one good way of using WatiN with MbUnit.

The sample introduces a new custom attribute called [Browser] with some
fancy behavior like:

* Capturing a screenshot if the test fails (or whenever you like).
* Embedding a video capture of the test run if the test fails (or whenever
you like).
* Running the same test repeatedly with different browsers.

The code is pretty easy to use so if you're already using MbUnit v3 and
WatiN then you should find it pretty easy to incorporate some of these
features from the samples into your own tests.

After installing Gallio v3.1 Update 1, look in %PROGRAMFILES%\Gallio\samples
for the WatiN samples and unzip them to a location of your choice.  You'll
need Visual Studio 2008 SP1 to run them out of the box.

Here's one of the sample tests to give you an idea of how this looks:


       /// <summary>
       /// Runs the same test repeatedly with different browsers.
       /// </summary>
       [Test]
       [Browser(BrowserType.IE)]
       [Browser(BrowserType.FireFox)]
       [Browser(BrowserType.Chrome)]
       public void MultipleBrowsers()
       {
           GoogleSearchPage.GoTo(Browser);
           Browser.Page<GoogleSearchPage>().Search("Fiddlesticks");
       }


Full announcement and download links:
http://blog.bits-in-motion.com/2009/10/announcing-gallio-and-mbunit-v31-upda
te.html


You can also see a sample video capture from a previous release here:
http://www.youtube.com/watch?v=rN0CmutflFs

Enjoy,
Jeff.

Technorati Tags: