public Component getComponentFromLastRenderedPage(String path, boolean wantVisibleInHierarchy) { return getComponentFromLastRenderedPage(path, wantVisibleInHierarchy, true); }
public Component getComponentFromLastRenderedPage(String path, boolean wantVisibleInHierarchy) { return getComponentFromLastRenderedPage(path, wantVisibleInHierarchy, true); }
/** * Gets the component with the given path from last rendered page. This method fails in case the * component couldn't be found, and it will return null if the component was found, but is not * visible. * * @param path * Path to component * @return The component at the path * @see org.apache.wicket.MarkupContainer#get(String) */ public Component getComponentFromLastRenderedPage(String path) { return getComponentFromLastRenderedPage(path, true); }
/** * Gets the component with the given path from last rendered page. This method fails in case the * component couldn't be found, and it will return null if the component was found, but is not * visible. * * @param path * Path to component * @return The component at the path * @see org.apache.wicket.MarkupContainer#get(String) */ public Component getComponentFromLastRenderedPage(String path) { return getComponentFromLastRenderedPage(path, true); }
/** * assert component invisible. * * @param path * path to component * @return a <code>Result</code> */ public Result isInvisible(String path) { return isNull("component '" + path + "' is visible", getComponentFromLastRenderedPage(path)); }
/** * assert component invisible. * * @param path * path to component * @return a <code>Result</code> */ public Result isInvisible(String path) { return isNull("component '" + path + "' is visible", getComponentFromLastRenderedPage(path)); }
/** * Submits the <code>Form</code> in the last rendered <code>Page</code>. * * @param path * path to <code>Form</code> component */ public void submitForm(String path) { Form form = (Form)getComponentFromLastRenderedPage(path); executeListener(form); }
/** * Submits the <code>Form</code> in the last rendered <code>Page</code>. * * @param path * path to <code>Form</code> component */ public void submitForm(String path) { Form<?> form = (Form<?>)getComponentFromLastRenderedPage(path); executeListener(form); }
/** * Creates a {@link FormTester} for the <code>Form</code> at a given path. * * @param path * path to <code>FormComponent</code> * @param fillBlankString * specifies whether to fill all child <code>FormComponent</code>s with blank * <code>String</code>s * @return a <code>FormTester</code> instance for testing the <code>Form</code> * @see FormTester */ public FormTester newFormTester(final String path, final boolean fillBlankString) { return new FormTester(path, (Form<?>)getComponentFromLastRenderedPage(path), this, fillBlankString); }
/** * Creates a {@link FormTester} for the <code>Form</code> at a given path. * * @param path * path to <code>FormComponent</code> * @param fillBlankString * specifies whether to fill all child <code>FormComponent</code>s with blank * <code>String</code>s * @return a <code>FormTester</code> instance for testing the <code>Form</code> * @see FormTester */ public FormTester newFormTester(final String path, final boolean fillBlankString) { return new FormTester(path, (Form<?>)getComponentFromLastRenderedPage(path), this, fillBlankString); }
/** * Simulates the firing of an Ajax event. * * @see #executeAjaxEvent(Component, String) * * @since 1.2.3 * @param componentPath * the <code>Component</code> path * @param event * the event which we simulate being fired. If <code>event</code> is * <code>null</code>, the test will fail. */ public void executeAjaxEvent(final String componentPath, final String event) { Component component = getComponentFromLastRenderedPage(componentPath); executeAjaxEvent(component, event); }
public Component assertExists(final String path) { Component component = getComponentFromLastRenderedPage(path); if (component == null) { fail("path: '" + path + "' does not exist for page: " + Classes.simpleName(getLastRenderedPage().getClass())); return null; } return component; }
public Component assertExists(final String path) { Component component = getComponentFromLastRenderedPage(path); if (component == null) { fail("path: '" + path + "' does not exist for page: " + Classes.simpleName(getLastRenderedPage().getClass())); return null; } return component; }
/** * assert the model of {@link ListView} use expectedList * * @param path * path to {@link ListView} component * @param expectedList * expected list in the model of {@link ListView} */ public void assertListView(String path, List expectedList) { ListView listView = (ListView)getComponentFromLastRenderedPage(path); WicketTesterHelper.assertEquals(expectedList, listView.getList()); }
/** * assert the model of {@link ListView} use expectedList * * @param path * path to {@link ListView} component * @param expectedList * expected list in the model of {@link ListView} */ public void assertListView(String path, List<?> expectedList) { ListView<?> listView = (ListView<?>)getComponentFromLastRenderedPage(path); WicketTesterHelper.assertEquals(expectedList, listView.getList()); }
/** * assert the text of <code>Label</code> component. * * @param path * path to <code>Label</code> component * @param expectedLabelText * expected label text * @return a <code>Result</code> */ public Result hasLabel(String path, String expectedLabelText) { Label label = (Label)getComponentFromLastRenderedPage(path); return isEqual(expectedLabelText, label.getDefaultModelObjectAsString()); }
/** * assert the text of <code>Label</code> component. * * @param path * path to <code>Label</code> component * @param expectedLabelText * expected label text * @return a <code>Result</code> */ public Result hasLabel(String path, String expectedLabelText) { Label label = (Label)getComponentFromLastRenderedPage(path); return isEqual(expectedLabelText, label.getDefaultModelObjectAsString()); }
public void assertNotExists(final String path) { Component component = getComponentFromLastRenderedPage(path, true, false); if (component != null) { fail("path: '" + path + "' does exists for page: " + Classes.simpleName(getLastRenderedPage().getClass())); } }
public void assertNotExists(final String path) { Component component = getComponentFromLastRenderedPage(path, true, false); if (component != null) { fail("path: '" + path + "' does exists for page: " + Classes.simpleName(getLastRenderedPage().getClass())); } }
/** * assert the text of <code>Label</code> component. * * @param path * path to <code>Label</code> component * @param expectedLabelText * expected label text * @return a <code>Result</code> */ public Result hasLabel(String path, String expectedLabelText) { Label label = (Label)getComponentFromLastRenderedPage(path); return isEqual(expectedLabelText, label.getDefaultModelObjectAsString()); }