use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class AbstractConsoleITCase method doLogin.
protected void doLogin(final String user, final String passwd) {
TESTER.startPage(Login.class);
TESTER.assertRenderedPage(Login.class);
FormTester formTester = TESTER.newFormTester("login");
formTester.setValue("username", user);
formTester.setValue("password", passwd);
formTester.submit("submit");
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class AbstractTypesITCase method createPlainSchema.
protected void createPlainSchema(final String key) {
browsingToPlainSchemas();
TESTER.clickLink("body:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:container:content:add");
TESTER.assertComponent("body:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:outerObjectsRepeater:0:outer", Modal.class);
final FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:" + "accordionPanel:tabs:0:body:content:outerObjectsRepeater:0:outer:form");
formTester.setValue("content:details:form:key:textField", key);
formTester.setValue("content:details:form:type:dropDownChoiceField", "3");
TESTER.clickLink("body:content:tabbedPanel:panel:" + "accordionPanel:tabs:0:body:content:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class AjaxPalettePanelITCase method isRendered.
@Test
public void isRendered() {
TestPage<String, AjaxPalettePanel<String>> testPage = new TestPage.Builder<String, AjaxPalettePanel<String>>().build(new AjaxPalettePanel.Builder<String>().setAllowOrder(true).build(TestPage.FIELD, SELECTED, ALL));
TESTER.startPage(testPage);
FormTester formTester = TESTER.newFormTester(testPage.getForm().getId());
formTester.submit();
Collection<String> list = testPage.getFieldPanel().getModelCollection();
assertEquals(2, list.size());
Iterator<String> iterator = list.iterator();
assertEquals("A", iterator.next());
assertEquals("D", iterator.next());
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class AnyObjectsITCase method editPrinter.
@Test
public void editPrinter() {
TESTER.clickLink("body:realmsLI:realms");
TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
Component component = findComponentByProp("key", CONTAINER + ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "8559d14d-58c2-46eb-a2d4-a7d35161e8f8");
assertNotNull(component);
TESTER.executeAjaxEvent(component.getPageRelativePath(), Constants.ON_CLICK);
TESTER.clickLink(TAB_PANEL + "outerObjectsRepeater:1:outer:container:content:togglePanelContainer:container:" + "actions:actions:actionRepeater:0:action:action");
FormTester formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
assertNotNull(formTester);
formTester.submit("buttons:next");
formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
assertNotNull(formTester);
formTester.submit("buttons:next");
formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
assertNotNull(formTester);
formTester.submit("buttons:next");
formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
assertNotNull(formTester);
formTester.submit("buttons:next");
TESTER.cleanupFeedbackMessages();
formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
assertNotNull(formTester);
formTester.submit("buttons:finish");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.assertComponent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:customResultBody:resources:" + "firstLevelContainer:first:container:content:group:beans:0:fields:0:field", Label.class);
TESTER.clickLink(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:action:actionRepeater:0:action:action");
component = findComponentByProp("key", CONTAINER + ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "8559d14d-58c2-46eb-a2d4-a7d35161e8f8");
assertNotNull(component);
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class AnyTypeClassesITCase method update.
@Test
public void update() {
final String plainSchema = "anyPlainSchema";
final String name = "anyTypeClassToUpdate";
createAnyTypeClassWithoutSchema(name);
createPlainSchema(plainSchema);
browsingToAnyTypeClasses();
Component component = findComponentByProp(KEY, DATATABLE_PATH, name);
TESTER.executeAjaxEvent(component.getPageRelativePath(), Constants.ON_CLICK);
// click edit
TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:1:outer:container:content:" + "togglePanelContainer:container:actions:actions:actionRepeater:0:action:action");
final FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
formTester.setValue("content:anyTypeClassDetailsPanel:form:container:plainSchemas:paletteField:recorder", plainSchema);
TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
component = findComponentByProp(KEY, DATATABLE_PATH, name);
assertNotNull(component);
TESTER.executeAjaxEvent(component.getPageRelativePath(), Constants.ON_CLICK);
TESTER.getRequest().addParameter("confirm", "true");
// click delete
TESTER.clickLink(TESTER.getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:1:outer:container:content:" + "togglePanelContainer:container:actions:actions:actionRepeater:1:action:action"));
TESTER.executeAjaxEvent(TESTER.getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:1:outer:container:content:" + "togglePanelContainer:container:actions:actions:actionRepeater:1:action:action"), Constants.ON_CLICK);
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
component = findComponentByProp(KEY, DATATABLE_PATH, name);
assertNull(component);
}
Aggregations