You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "manthos (JIRA)" <ji...@apache.org> on 2011/02/22 14:25:38 UTC
[jira] Commented: (WICKET-1214) WicketTester#startPanel does not
work (correctly)
[ https://issues.apache.org/jira/browse/WICKET-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997789#comment-12997789 ]
manthos commented on WICKET-1214:
---------------------------------
There are still some methods in BaseWicketTester using 'getLastRenderedPage().get(path)' instead of 'getComponentFromLastRenderedPage(path)'.
isVisible(String path)
isEnabled(String path)
isDisabled(String path)
isRequired(String path)
... so using BaseWicketTester with startPanel ist not straightforward.
Example before:
tester.startPanel(HelloWorldPanel.class);
tester.assertLabel(DummyPanelPage.TEST_PANEL_ID + ":message", "Hello, World!");
tester.assertComponent(DummyPanelPage.TEST_PANEL_ID + ":message", Label.class);
tester.assertVisible(DummyPanelPage.TEST_PANEL_ID + ":message");
now:
tester.startPanel(HelloWorldPanel.class);
tester.assertLabel("message", "Hello, World!"); // no need to have panel:message
tester.assertComponent("message", Label.class); // dito
tester.assertVisible(DummyPanelPage.TEST_PANEL_ID + ":message"); // still needed!
I've attached patch1.patch. Please review. Would be nice to have this straightforward in 1.5
> WicketTester#startPanel does not work (correctly)
> -------------------------------------------------
>
> Key: WICKET-1214
> URL: https://issues.apache.org/jira/browse/WICKET-1214
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-M1
> Reporter: Martijn Dashorst
> Assignee: Juergen Donnerstag
> Fix For: 1.5-RC1
>
>
> WicketTester#startPanel(class<? extends Panel>) does not work with the assertions:
> WicketTester tester = new WicketTester();
> tester.startPanel(HelloWorldPanel.class);
> tester.assertLabel("message", "Hello, World!");
> Will throw an exception because "message" can't be found. In the response page the panel is added with component identifier "panel". However as a tester I expect to be able to assert the components directly without having to know what happens internally.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira