Continuous Integration with WebAii Tests for Silverlight, NUnit and CruiseControl.NET

2 posts, 0 answers
  1. Sebastian Klapp
    Sebastian Klapp avatar
    1 posts
    Member since:
    Sep 2009

    Posted 20 Oct 2009 Link to this post

    Requirements

    WebAii TF version

    2009.2.1006.20
    RadControls version

    2009.2.1014.1030
    .NET version

    3.5 SP1
    Visual Studio version

    VS 2008
    programming language

    C#
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION

    Continuous Integration means that members of a software development team integrate their work frequently, usually every person at least once per day- leading to multiple integrations per day. Each integration triggers an automated build (including test) to detect integration errors as quickly as possible.

    This is an example how you can use CruiseControl.NET and NUnit for your automated Silverlight build and run the WebAii Tests for Silverlight afterwards. Please look at the attached Silverlight project “SampleNUNitTest”.

    Requirements for this continuous integration example
    You need to install the following software/tools (Please install at c:\Program files):

    Additionally:
    • A version control system like SubVersion (Subversion is a free/open-source version control system)
    • TightVNC (or another kind of remote control software) -- please see the last paragraph for details.
    • Configure a virtual directory “uitest” in IIS that refer to SampleApp (e.g. D:\projects\SampleApp\SampleApp.Web)

    Sample Application
    In SampleApp you can find a small solution including a test project using WebAii Testing Framework. UITestclass (TreeViewUITest.cs) that is created with the NUnit template that you can find after Testing Framework installation in VisualStudio in template folder Test\WebAii 2.0. A manual for creating Tests using NUnit and how to configure you can find at the WebAii documentation:
    http://www.artoftest.com/support/webaii/topicsindex.aspx?topic=usingnunit

    For starting tests manually, please start NUnit and select SampleApp\UITest\bin\Debug\UITest.dll:



    You can also debug the tests. Right click on the TreeViewUITest.cs in VisualStudio and select “debug unit tests” (see also the attachment for the large snapshot):


    Configure Continous Integration
    In continuous integration you won’t start tests manually. Every build will include a test at the end in order to make sure that your application is running correctly. This thread shall help you understand and setup a continuous integration system including UI functional tests.

    For starting a continuous integration system you will need a tool that supports the automated build process. In this example, we use CruiseControl.NET. You can configure CruiseControl.NET in many ways. In ccnet.config file (find attached) you can find an example. For detailed information please check CruiseControl.NET-Documentation).

    The following tasks will be executed:

    If you are working as a team, you will use a version control system. In this example I use SubVersion.
    <!-- information for source control, e.g. SubVersion --> 
    <sourcecontrol type="svn">   
      ... 
    </sourcecontrol>   

    You can configure CruiseControl.NET to check for integrations in continuous intervals. In CCNet.config I defined a trigger for starting checks every 10 seconds.
    <!-- trigger for starting integration checks--> 
    <triggers>    
        <intervalTrigger name="Subversion" seconds="10" />    
    </triggers> 

    If modifications are found, defined tasks will be started. Look at the tasks-Tag in ccnet.config : After updating source, the solution will be compiled by using devenv (<devenv>). And after that, tests will start (<nunit>).

    Please note CruiseControl.NET will need some folders for work:
    • "D:\projects\CCNET\SampleApp\WorkDir\"
      Working folder for CC.NET. Source control system (SVN) will allocate project source here.
    • "D:\projects\CCNET\SampleApp\Artifacts\"
      Directory for build-logs.

    UI Testing requires local session with an unlocked screen
    UI testing really needs to be done on the local session with an unlocked screen (i.e. not in Screen Saver mode, or at the logon prompt) because drawing events are only sent correctly if the browser windows is visible. Usually you won’t have a local session on your continuous integration system.

    A possible workaround is to install a VNCServer (e.g. TightVNC) and start a session via VNC. Disable screen saver and do not log off the windows session. In this way it’s the same as if there is a local session, so UI tests will run successfully. It’s important that nobody logs on using Remote Desktop as the main screen will be locked and drawing events will not be thrown anymore.
  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 21 Oct 2009 Link to this post

    Hello Sebastian,

    Indeed, the integration of the WebAii Testing Framework tests with NUnit and CC.NET additionally could be quite powerful as a Continuous Integration system!

    Thank you for the Code Library submission!

    Regards,
    Konstantin Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top