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

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

[~mgrigorov] - yes, they indeed fail in DEV mode and do not fail in PROD mode.
What I want to say by this issue is:
"If page can not be rendered *properly* because of lack of markup - tests 
should fail *both* on PROD and DEV"

I'm open for discussion - what are the arguments for not failing test in PROD 
even if clearly page can not be rendered as desired?

> 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