use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class RealmsITCase method verifyPropagation.
@Test
public void verifyPropagation() {
TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:btn", Constants.ON_CLICK);
TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:dropdown-menu:buttons:2:button", Constants.ON_CLICK);
TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:actions:actions:actionRepeater:1:action:action");
TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:form:view:details:" + "container:generics:name:textField", "even");
FormTester formTester = TESTER.newFormTester("body:content:body:outerObjectsRepeater:0:outer:form:content:form");
formTester.setValue("view:details:container:resources:paletteField:recorder", "resource-ldap-orgunit");
formTester.submit("buttons:finish");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
// ----------------------------------
// Check for propagation results
// ----------------------------------
Component component = findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:" + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit");
TESTER.clickLink(component.getPageRelativePath() + ":actions:actionRepeater:0:action:action");
TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:0:value:oldAttribute:field-label", "__NAME__");
TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:0:value:oldAttribute:textField", null);
TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:0:value:newAttribute:field-label", "__NAME__");
TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:0:value:newAttribute:textField", "ou=even,o=isp");
TESTER.clickLink("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:back");
assertNotNull(findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:" + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit"));
// ----------------------------------
TESTER.executeAjaxEvent("body:content:body:outerObjectsRepeater:0:outer:form:content:action:actionRepeater:" + "0:action:action", Constants.ON_CLICK);
TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:actions:actions:actionRepeater:1:action:action");
TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:form:view:details:" + "container:generics:name:textField", "even");
formTester = TESTER.newFormTester("body:content:body:outerObjectsRepeater:0:outer:form:content:form");
formTester.setValue("view:details:container:resources:paletteField:recorder", "");
formTester.submit("buttons:finish");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
// ----------------------------------
// Check for propagation results
// ----------------------------------
component = findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:" + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit");
TESTER.clickLink(component.getPageRelativePath() + ":actions:actionRepeater:0:action:action");
TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:4:value:oldAttribute:field-label", "ou");
TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:4:value:oldAttribute:textField", "even");
TESTER.assertLabel("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:4:value:newAttribute:field-label", "ou");
TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:second:remoteObject:propView:4:value:newAttribute:textField", null);
TESTER.clickLink("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:" + "secondLevelContainer:back");
assertNotNull(findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:" + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit"));
// ----------------------------------
TESTER.executeAjaxEvent("body:content:body:outerObjectsRepeater:0:outer:form:content:action:actionRepeater:" + "0:action:action", Constants.ON_CLICK);
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class RealmsITCase method addUserTemplate.
@Test
public void addUserTemplate() {
TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:btn", Constants.ON_CLICK);
TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:dropdown-menu:buttons:4:button", Constants.ON_CLICK);
TESTER.assertLabel("body:content:realmChoicePanel:container:realm", "/odd");
TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:actions:actions:actionRepeater:2:action:action");
TESTER.assertComponent("body:content:toggleTemplates", TogglePanel.class);
FormTester formTester = TESTER.newFormTester("body:content:toggleTemplates:container:content:togglePanelContainer:templatesForm");
formTester.setValue("type:dropDownChoiceField", "0");
formTester.submit("changeit");
TESTER.assertComponent("body:content:templateModal", Modal.class);
formTester = TESTER.newFormTester("body:content:templateModal:form:content:form");
formTester.setValue("view:username:textField", "'k' + firstname");
formTester.submit("buttons:finish");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
TESTER.assertLabel("body:content:realmChoicePanel:container:realm", "/odd");
TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:actions:actions:actionRepeater:2:action:action");
TESTER.assertComponent("body:content:toggleTemplates", TogglePanel.class);
formTester = TESTER.newFormTester("body:content:toggleTemplates:container:content:togglePanelContainer:templatesForm");
formTester.setValue("type:dropDownChoiceField", "0");
formTester.submit("changeit");
TESTER.assertComponent("body:content:templateModal", Modal.class);
TESTER.assertModelValue("body:content:templateModal:form:content:form:view:username:textField", "'k' + firstname");
formTester = TESTER.newFormTester("body:content:templateModal:form:content:form");
formTester.setValue("view:username:textField", "");
formTester.submit("buttons:finish");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class ReportsITCase method createReport.
private void createReport(final String name) {
TESTER.clickLink("body:content:tabbedPanel:panel:firstLevelContainer:first:container:content:add");
TESTER.assertComponent("body:content:tabbedPanel:panel:firstLevelContainer:first:outerObjectsRepeater:0:outer", Modal.class);
FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:firstLevelContainer:first:outerObjectsRepeater:0:outer:form");
formTester.setValue("content:form:view:name:textField", name);
formTester.setValue("content:form:view:template:dropDownChoiceField", "0");
formTester.submit("content:form:buttons:next");
TESTER.assertComponent("body:content:tabbedPanel:panel:firstLevelContainer:first:outerObjectsRepeater" + ":0:outer:form:content:form:view:schedule:seconds:textField", TextField.class);
formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:firstLevelContainer:first:outerObjectsRepeater:0:outer:form");
formTester.submit("content:form:buttons:finish");
TESTER.assertInfoMessages("Operation executed successfully");
TESTER.cleanupFeedbackMessages();
TESTER.clickLink("body:reportsLI:reports");
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class SchemasITCase method createPlainSchema.
@Test
public void createPlainSchema() {
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", "zBoolean");
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();
TESTER.assertRenderedPage(Types.class);
}
use of org.apache.wicket.util.tester.FormTester in project syncope by apache.
the class SchemasITCase method updatePlainSchema.
@Test
public void updatePlainSchema() {
browsingToPlainSchemas();
Component result = findComponentByProp(KEY, PLAIN_DATATABLE_PATH, "ctype");
TESTER.assertLabel(result.getPageRelativePath() + ":cells:1:cell", "ctype");
assertNotNull(result);
TESTER.executeAjaxEvent(result.getPageRelativePath(), Constants.ON_CLICK);
TESTER.clickLink("body:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:outerObjectsRepeater:1:outer:" + "container:content:togglePanelContainer:container:actions:actions:actionRepeater:0:action:action");
TESTER.assertComponent("body:content:tabbedPanel:" + "panel:accordionPanel:tabs:0:body:content:outerObjectsRepeater:0:outer:" + "form:content:kindForm:kind:dropDownChoiceField", DropDownChoice.class);
FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:outerObjectsRepeater:0:outer:form");
formTester.setValue("content:details:form:multivalue:checkboxField", "true");
TESTER.clickLink("body:content:tabbedPanel:panel:" + "accordionPanel:tabs:0:body:content:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit", true);
TESTER.assertInfoMessages("Operation executed successfully");
}
Aggregations