Kamil created WICKET-6420:
-----------------------------

             Summary: 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