On Sat, Jul 27, 2013 at 4:53 PM, Antonia Horincar <
[email protected]> wrote:

> Hi,
>
> I have a question regarding testing. My plugin consists only of controllers
> and views, and doesn't include models, therefore I can't do unit tests on
> it. What kind of tests should I write?
>
> Thanks,
> Antonia


The functional tests that Olemis mentioned are written in Twill, with
wrapper and library of supporting functions written by the Trac team, found
in the trac/tests/functional module.

I found getting up to speed on writing the functional tests in Twill to be
a bit challenging, and I spent many frustrating hours dealing with various
little issues before I started to feel at least minimally proficient. As an
example of the issues I encountered, see:
http://trac.edgewall.org/ticket/11118#comment:3

The other drawback is that you can't test JavaScript code with Twill.

I think what we really need is to replace Twill with a different functional
testing framework, but that is a large project of its own. Therefore, I
think your best move is to write the unit tests as Olemis suggests, and
maybe we'll add a few Twill functional tests before the work is integrated
to the Bloodhound trunk, but I wouldn't suggest spending too much time on
that yourself, at least until you feel your project has reached all of its
major milestones.

Reply via email to