Unit testing SharePoint

We are doing extensive development for SharePoint Portal Server for one of our large customers. Besides producing a lot of interesting code, we are also settings up a kind of software factory for SharePoint development. More on this in later posts.

We now have the continuous integration builds and automatic deployments up and running. Units tests against the business code can be executed, and FxCop checks are done on the code.

The next step is automatically testing the deployment against a set of pages, where each page represents (part of) a use case. Are web parts functioning? Do they give the output you expect? Are skinning actions done by the MacawSharePointSkinner successful?

I’m currently looking into IeUnit. This looks like a very powerful web page testing framework, you run javascript tests that can directly talk against the DOM in IE, these tests can be executed from the command line, and the results can be output in an XML format that can be interpreted and merged by CruiseControl.Net (our Continuous Integration platform).

The test framework is extensible, so it would be great to extend it with the knowledge of zones, web parts, and other SharePoint specific functionality.

Did someone already go in this direction, or do you have other tips on testing the resulting web pages of SharePoint Portal Server? Please enlighten me!

2 Comments

  • Serge,

    The furthest we've considered going with this is to use simplistic "go-nogo" stuff on UI testpages. We're doing all webpart dev as SmartParts thus beeing able to perform tests on the ASP.NET controls, leaving sharepoint out of it.



    Kris (Syverstad) is doing a lot with CCNET and SPS, but in the context of sitedefs.



    When we write code customizing sharepoint we keep it extremely simple and in small units of functionality. Usually we expose this functionality as add-on webservices to the exising ones in sharepoint.



    Establishing a framework for testing requires a project of considerable size as you're talking about.

  • I hardly write responses, however i did some searching and wound up here Unit testing SharePoint - Serge van den Oever [Macaw].
    And I do have a few questions for you if you don't mind. Is it only me or does it look like a few of these responses come across like written by brain dead individuals? :-P And, if you are posting at other places, I would like to follow anything new you have to post. Could you make a list of all of your community pages like your twitter feed, Facebook page or linkedin profile?

Comments have been disabled for this content.