Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI Testing Framework + Continuous Integration?

So I have an application that I inherited and I want to build up an automated test suite around it. The application wasn't designed with testability in mind, and the code is a "big ball of mud". My plan was to use a UI Automation testing framework and create a suite of tests at the UI level until I had enough coverage to allow me to start refactoring with confidence and introducing some seams into the code to improve testability and design.

It's a .Net WinForms application, and the two frameworks I'm aware of are:

NUnitForms

and

Project White

From what I've read both frameworks pose issues when trying to run as part of an automated build (Continuous Integration) due to the fact that most CI products run as a Windows Service and if the UI uses modal dialogs the application will die a horrible death. I'm using CruiseControl.Net as my CI tool.

Does anybody have any suggestions to work around this issue? An alternative framework to use that may make the situation better?

Thanks,

Dylan

like image 729
Dylan Smith Avatar asked Feb 10 '09 16:02

Dylan Smith


2 Answers

NUnitForms has a "hidden desktop" feature that will let you run unit tests from cc.net.

http://automaticchainsaw.blogspot.com/2007/09/winforms-testing-using-nunitforms.html http://automaticchainsaw.blogspot.com/2007/09/hidden-desktops-and-nunitforms.html

like image 62
Pedro Avatar answered Oct 27 '22 01:10

Pedro


You can actually run cruise control via the console app so it can have interactive desktop access. It won't recover automatically if the server is rebooted or it crashes, but at least you can do it.

That said, the approach most people take with automated UI testing (winforms, wpf or web) is to run all the non-interactive tests via the build server. Once those tests pass, then they deploy the application to a test environment and manually trigger a test run against the newly built version of the code.

This gives people the chance to reset the test environment (important for UI testing) as well as check that he new version of the application was built correctly and that all unit tests passed. After all, there's no point running the UI tests if you know the unit tests fell over. :-)

like image 32
Richard Banks Avatar answered Oct 27 '22 00:10

Richard Banks