Hi,

I hit the very same problem while trying to make a test case for
https://issues.apache.org/jira/browse/WICKET-4172.
It seems WicketTester is not able to check that because the Enclosure
component is used only at render time (the so called 'auto component')
where it says "I'm not visible" and thus all its children are not
rendered.
But with WicketTester.assert(In)Visible() you actually do:
page.get("some:path").isVisible() and here there is no knowledge about
the Enclosure at all and #isVisibleInHierarchy() returns "true" for
comp2.

It seems the only way to verify that comp2 is invisible when an
enclosure is involved is to assert that there is no markup for it in
the rendered page as string.

On Mon, Oct 31, 2011 at 3:01 PM, Sebastiaan van Erk <[email protected]> wrote:
> Hi,
>
> I'm using WicketTester to assertInvisible some components. Now I have the
> following situation:
>
> <wicket:enclosure child="comp1">
>  <div wicket:id="comp1"></div>
>  <div wicket:id="comp2"></div>
> </wicket:enclosure>
>
> In the code I say comp1 is invisible, so the whole enclosure is invisible.
> However, in WicketTester, assertInvisible("comp2") fails.
>
> I am aware of a previous post about this:
> http://apache-wicket.1842946.n4.nabble.com/WicketTester-assertInvisible-td3303769.html
>
> However, I don't really see an answer there. What is the expected behavior
> of WicketTester, and is this bug? Or am I doing something wrong?
>
> Best regards,
> Sebastiaan
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to