Automated testing for Tridion templates: Followup

Earlier this week I released two blog posts on automated testing for Tridion templates. The idea to blog about this subject came from this stack overflow thread where several members from the Tridion community were discussing automated testing for Tridion templates. The technical solutions I offered in my last blog post each have their specific limitations. A post on the before mentioned thread by Nuno Linhares triggered my interest. He mentioned a web service that the template builder uses to debug templates.

After some research it turns out this web service is a really solution to achieve automated testing for templates.  In essence, you feed the web service some basic data, the template is executed and the package with its content is returned to you.  The whole solution was easy to setup, I created a demo solution to share with the community. All you have to do is add the reference to the service and you’re good to go. Check the config file for the service definition location on the Tridion content management machine.

Implementing automated testing this way has to following advantages and limitations:

Advantages: This solution is quite easy to setup and be used right away since it does not require any changes to the existing templates. Since we use a web service provided by Tridion there we can be sure the output is reliable.

Limitations: This solution only enables automated testing for complete template building blocks or templates. Testing individual functions within a template building block is not possible with this solution alone.

Wrapping up

This approach is a very pragmatic way to test Tridion templates. Normally I would be put off by the fact that individual functions cannot be tested. But since template are data transformations making assertions on the output is pretty much all you need.

Using the same web service as the template builder turned out to be a very sweet deal. I wonder why Tridion doesn’t document and offer this solution as a way to automate testing for templates. I would be happy to write a more detailed article plus a demo project for the Tridion world platform if I was asked ;)

2 thoughts on “Automated testing for Tridion templates: Followup

  1. Hey Oskar,

    Why don’t you write an article about this, and a demo project? Perhaps you could put it on Tridion World!

    There – now you’ve been asked!

    Seriously, though. It shouldn’t be difficult to get your article published on Tridion World. Just get in touch with Tridion, and I’m sure they’ll welcome your contribution.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>