You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nick Pratt <nb...@gmail.com> on 2013/11/21 18:12:33 UTC

WicketTester - asserting on HTML

Is it possible to to make assertions on the rendered HTML of a Wicket page?

Im trying to make assertions on element attributes (class contents
specifically).  Is this possible with WicketTester?

N

Re: WicketTester - asserting on HTML

Posted by Kees van Dieren <in...@squins.com>.
You could use the TagTester for that.

Example:

        // <span wicket:id="myLabel" class="one-class, another-class">hello
world</span>
        TagTester tester = wicketTester.getTagByWicketId("myLabel");

        assertTrue(tester.getAttributeContains("class", "one-class"));
        assertTrue(tester.getAttributeContains("class", "another-class"));
        assertFalse(tester.getAttributeContains("class", "not-this-class"));


Best regards / Met vriendelijke groet,

Kees van Dieren
Squins IT Solutions BV
Oranjestraat 30
2983 HS Ridderkerk
The Netherlands
Mobile: +31 (0)6 30413841
www.squins.com
Chamber of commerce Rotterdam: 24435103


2013/11/21 Martin Makundi <ma...@koodaripalvelut.com>

> assertContains
>
>
> 2013/11/21 Nick Pratt <nb...@gmail.com>
>
> > Is it possible to to make assertions on the rendered HTML of a Wicket
> page?
> >
> > Im trying to make assertions on element attributes (class contents
> > specifically).  Is this possible with WicketTester?
> >
> > N
> >
>

Re: WicketTester - asserting on HTML

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
assertContains


2013/11/21 Nick Pratt <nb...@gmail.com>

> Is it possible to to make assertions on the rendered HTML of a Wicket page?
>
> Im trying to make assertions on element attributes (class contents
> specifically).  Is this possible with WicketTester?
>
> N
>