use of org.apache.wicket.util.tester.FormTester in project wicket by apache.
the class FormPageTest method formAndLinkAreSubmitted.
/**
*/
@Test
public void formAndLinkAreSubmitted() {
tester.startPage(FormPage.class);
FormPage page = (FormPage) tester.getLastRenderedPage();
Assert.assertFalse(page.isSubmitLinkSubmitted());
Assert.assertFalse(page.isFormSubmitted());
FormTester formTester = tester.newFormTester("form");
formTester.submitLink("link", true);
page = (FormPage) tester.getLastRenderedPage();
Assert.assertTrue(page.isFormSubmitted());
Assert.assertTrue(page.isSubmitLinkSubmitted());
}
use of org.apache.wicket.util.tester.FormTester in project wicket by apache.
the class FormPageTest method formIsSubmitted.
/**
*/
@Test
public void formIsSubmitted() {
tester.startPage(FormPage.class);
FormPage page = (FormPage) tester.getLastRenderedPage();
Assert.assertFalse(page.isSubmitLinkSubmitted());
Assert.assertFalse(page.isFormSubmitted());
FormTester formTester = tester.newFormTester("form");
formTester.submit();
page = (FormPage) tester.getLastRenderedPage();
Assert.assertTrue(page.isFormSubmitted());
Assert.assertFalse(page.isSubmitLinkSubmitted());
}
use of org.apache.wicket.util.tester.FormTester in project wicket by apache.
the class ValidatorStringResourceLoaderTest method formValidator.
@Test
public void formValidator() {
tester.startPage(new FormValidatorPage());
FormTester formTester = tester.newFormTester("form");
formTester.setValue("field1", "value1");
formTester.setValue("field2", "value2");
formTester.submit();
tester.assertErrorMessages("Form Validator loaded OK");
}
use of org.apache.wicket.util.tester.FormTester in project wicket by apache.
the class ValidatorStringResourceLoaderTest method interfaceValidator.
/**
* Tests that resource bundle is properly loaded for implementations of
* IValidator need to be wrapped in ValidatorAdapter
*
* https://issues.apache.org/jira/browse/WICKET-4379
*/
@Test
public void interfaceValidator() {
tester.startPage(new ValidatorLoaderPage(new InterfaceValidator()));
FormTester formTester = tester.newFormTester("form");
formTester.setValue("passwd", "anything");
formTester.submit();
tester.assertErrorMessages("Interface error loaded OK");
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class PoliciesITCase method createPullPolicy.
private void createPullPolicy(final String description) {
TESTER.clickLink("body:content:tabbedPanel:tabs-container:tabs:2:link");
TESTER.clickLink("body:content:tabbedPanel:panel:container:content:add");
TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);
Component modal = TESTER.getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer");
FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
formTester.setValue("content:fields:0:field:textField", description);
TESTER.executeAjaxEvent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit", Constants.ON_CLICK);
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
closeCallBack(modal);
Component component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:" + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);
assertNotNull(component);
TESTER.executeAjaxEvent(component.getPageRelativePath(), Constants.ON_CLICK);
TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:1:outer:container:content:" + "togglePanelContainer:container:actions:actions:actionRepeater:0:action:action");
TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);
TESTER.assertModelValue("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form" + ":content:fields:0:field:textField", description);
TESTER.executeAjaxEvent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:buttons:0:button", Constants.ON_CLICK);
assertNotNull(findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:" + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description));
}
Aggregations