[ 
https://issues.apache.org/jira/browse/WICKET-6420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16085547#comment-16085547
 ] 

Kamil commented on WICKET-6420:
-------------------------------

Well, they *should* fail, because of lack of proper wicket:id in markup.
The question is why they fail in DEPLOYMENT (which is expected behavior) and 
*not* fail in DEVELOPMENT (although missing wicket:id in markup, which is 
clearly an error)

> WicketTester asserts passes even though page not renders
> --------------------------------------------------------
>
>                 Key: WICKET-6420
>                 URL: https://issues.apache.org/jira/browse/WICKET-6420
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 8.0.0-M6
>            Reporter: Kamil
>
> I have a page
> {code}
> public class MyPage extends WebPage {
>     @Override
>     protected void onInitialize() {
>         super.onInitialize();
>         add(new AjaxLink<Void>("myButton") {
>             @Override
>             public void onClick(final AjaxRequestTarget target) {
>             }
>         });
>     }
> }
> {code}
> markup:
> {code}
> <!DOCTYPE html>
> <html lang="en-us" xmlns:wicket="http://wicket.apache.org";>
> <head>
> </head>
> <body>
> </body>
> </html>
> {code}
> although when I enter the page in the browser, I get:
> {code}
> Last cause: The component(s) below failed to render. Possible reasons could 
> be that:
>       1) you have added a component in code but forgot to reference it in the 
> markup (thus the component will never be rendered)
> {code}
> these tests are passing:
> {code}
>     @Test
>     public void hasMyButton() throws Exception {
>         //when
>       wicketTester.startPage(MyPage.class);
>         //then
>       wicketTester.assertComponent("myButton", AjaxLink.class);
>       wicketTester.assertVisible("myButton");
>         wicketTester.assertContains("myButton");
>         wicketTester.assertNoErrorMessage();
>         wicketTester.assertRenderedPage(MyPage.class);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to