/** * Retrieves a <code>TagTester</code> based on an DOM id. If more <code>Component</code>s exist * with the same id in the markup, only the first one is returned. * * @param id * the DOM id to search for. * @return the <code>TagTester</code> for the tag which has the given DOM id */ public TagTester getTagById(String id) { return TagTester.createTagByAttribute(getLastResponseAsString(), "id", id); }
/** * Modified version of BaseWicketTester#getTagByWicketId(String) that returns all matching tags * instead of just the first. * * @param wicketId * @return List of Tags */ public List<TagTester> getTagsByWicketId(String wicketId) { return TagTester.createTagsByAttribute(getLastResponseAsString(), "wicket:id", wicketId, false); }
public void testFormSubmit() throws Exception { tester.startPage(WMSAdminPage.class); FormTester ft = tester.newFormTester("form"); ft.submit("submit"); tester.assertNoErrorMessage(); tester.assertRenderedPage(GeoServerHomePage.class); }
public void testMissingStyle() throws Exception { FormTester form = tester.newFormTester("form"); form.setValue("name", "test"); form.submit(); tester.assertRenderedPage(StyleNewPage.class); tester.assertErrorMessages(new String[] {"Field 'SLD' is required."}); }
public void testEditBasic() { // print(tester.getLastRenderedPage(), true, true); FormTester ft = tester.newFormTester("form"); ft.select("panel:language", 0); ft.setValue("panel:metadataURL", "http://www.geoserver.org/test"); ft.select("panel:metadataURLType", 0); ft.submit(); // print(tester.getLastRenderedPage(), true, true); tester.assertModelValue("form:panel:language", "bul"); tester.assertModelValue("form:panel:metadataURL", "http://www.geoserver.org/test"); tester.assertModelValue("form:panel:metadataURLType", "application/vnd.ogc.csw.GetRecordByIdResponse_xml"); }
/** * Renders the <code>Page</code>. * * @param page * a <code>Page</code> to render * @return the rendered <code>Page</code> */ public final Page startPage(final Page page) { return startPage(new TestPageSource(page)); }
public void onClick() { setResponsePage(testPageSource.getTestPage()); } }
@Override public void onClick() { setResponsePage(getTestPage()); } }
/** * Constructor. * * @param testPanelSource * a <code>TestPanelSource</code> */ public DummyPanelPage(final ITestPanelSource testPanelSource) { add(testPanelSource.getTestPanel(TEST_PANEL_ID)); } }
/** * Constructor. * * @param testPanelSource * a <code>TestPanelSource</code> */ public DummyPanelPage(final TestPanelSource testPanelSource) { add(testPanelSource.getTestPanel(TEST_PANEL_ID)); } }
/** * Dumps the <code>Component</code> trees. */ public void debugComponentTrees() { debugComponentTrees(""); }
public void testMissingName() throws Exception { FormTester form = tester.newFormTester("form"); form.setValue("name", ""); form.submit(); tester.assertRenderedPage(StyleEditPage.class); tester.assertErrorMessages(new String[] {"Field 'Name' is required."}); }
/** * Retrieves a <code>TagTester</code> based on an DOM id. If more <code>Component</code>s exist * with the same id in the markup, only the first one is returned. * * @param id * the DOM id to search for. * @return the <code>TagTester</code> for the tag which has the given DOM id */ public TagTester getTagById(String id) { return TagTester.createTagByAttribute(getLastResponseAsString(), "id", id); }
/** * Modified version of BaseWicketTester#getTagByWicketId(String) that returns all matching tags * instead of just the first. * * @param wicketId * @return List of Tags */ public List<TagTester> getTagsByWicketId(String wicketId) { return TagTester.createTagsByAttribute(getLastResponseAsString(), "wicket:id", wicketId, false); }
@Override public void onClick() { setResponsePage(getTestPage()); } }
/** * Retrieves a <code>TagTester</code> based on a <code>wicket:id</code>. If more * <code>Component</code>s exist with the same <code>wicket:id</code> in the markup, only the * first one is returned. * * @param wicketId * the <code>wicket:id</code> to search for * @return the <code>TagTester</code> for the tag which has the given <code>wicket:id</code> */ public TagTester getTagByWicketId(String wicketId) { return TagTester.createTagByAttribute(getLastResponseAsString(), "wicket:id", wicketId); }
/** * Retrieves a <code>TagTester</code> based on a <code>wicket:id</code>. If more * <code>Component</code>s exist with the same <code>wicket:id</code> in the markup, only the * first one is returned. * * @param wicketId * the <code>wicket:id</code> to search for * @return the <code>TagTester</code> for the tag which has the given <code>wicket:id</code> */ public TagTester getTagByWicketId(String wicketId) { return TagTester.createTagByAttribute(getLastResponseAsString(), "wicket:id", wicketId); }