add a trait to allow simple extensibility of existing test base classes

Many frameworks/other kind of projects already provide base classes, for generic
functionality. Using a base class approach for the DOM assertions is problematic,
because of the classical inheritance problem then.

Let's add trait, to make it easier to extend existing test classes.