zope.testrecorder is simple to install: just add it to your eggs list under your buildout’s relevant instance section, and also the corresponding zcml list too. Re-run your buildout and you will now have the latest version of the package installed.
There’s some good documentation out there about this, such as Martin Aspeli’s article on plone.org, but it’s slightly dated given latest updates with the package. Essentially, everything is relevant with the exception of how to actually access the test recorder now. Enter PyYou’s post about this same topic. Thanks to that article I now know you should go to http://zopehost:port/++resource++recorder/index.html to access the test recorder, and not try and add an object in the root of Zope (or elsewhere).
Aside from that, the recorder works like a charm. You input the address of what site (it can be anything or anywhere) you want to test and click the ‘Go’ button. Everything you do (mostly) gets monitored and recorded. A few words to the wise though:
- You’ll need to manually intervene with the rendered tests and fix some things up. For example, testing the default title of a Plone site doesn’t work because there’s a hyphen in the title. It’s a special character and thus saved “incorrectly” within the doctests.
Aside from all that, most of the heavy lifting is done for you, so cheers to the creators of zope.testrecorder for making my life just that bit easier.Go Top