| java.lang.Object wicket.util.tester.FormTester
FormTester | public class FormTester (Code) | | A helper for testing validaiton and submission of Form component.
author: Ingram Chen |
Inner Class :abstract protected class ChoiceSelector | |
Method Summary | |
public void | select(String formComponentId, int index) simulate selecting an option of a Form Component. | public void | selectMultiple(String formComponentId, int[] indexes) A convenient method to select multiple options for the form component. | public void | setValue(String formComponentId, String value) simulate filling a field of a Form. | public void | submit() submit the form. | public void | submit(String buttonComponentId) A convenient method to submit form with alternative button. |
FormTester | protected FormTester(String path, Form workingForm, WicketTester wicketTester, boolean fillBlankString)(Code) | | See Also: WicketTester.newFormTester(String) Parameters: path - path to form component Parameters: workingForm - form component to be test Parameters: wicketTester - wicketTester that create FormTester Parameters: fillBlankString - specify whether filling child Text Components with blankString |
select | public void select(String formComponentId, int index)(Code) | | simulate selecting an option of a Form Component. Support RadioGroup,
CheckGroup, and AbstractChoice family currently. The behavior is similar
to interacting on the browser: For single choice, such as Radio or
DropDownList, the selection will toggle each other. For multiple choice,
such as Checkbox or ListMultipleChoice, the selection will cumulate.
Parameters: formComponentId - relative path (from form) to selectable formComponent Parameters: index - index of selectable option, start from 0 |
selectMultiple | public void selectMultiple(String formComponentId, int[] indexes)(Code) | | A convenient method to select multiple options for the form component.
The method only support multiple selectable form component.
See Also: FormTester.select(String,int) Parameters: formComponentId - relative path (from form) to selectable formComponent Parameters: indexes - index of selectable option, start from 0 |
setValue | public void setValue(String formComponentId, String value)(Code) | | simulate filling a field of a Form.
Parameters: formComponentId - relative path (from form) to formComponent Parameters: value - field value of form. |
submit | public void submit()(Code) | | submit the form. note that submit() can be executed only once.
|
submit | public void submit(String buttonComponentId)(Code) | | A convenient method to submit form with alternative button.
Note that if the button associates with a model, it's better to use
setValue() instead:
formTester.setValue("to:my:button", "value on the button");
formTester.submit();
Parameters: buttonComponentId - relative path (from form) to the button |
|
|