Search in sources :

Example 61 with FormTester

use of org.apache.wicket.util.tester.FormTester in project syncope by apache.

the class SchemasITCase method deletePlainSchema.

@Test
public void deletePlainSchema() {
    browsingToPlainSchemas();
    // create new Plain Schema
    final String schemaName = "zStringDelete";
    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", schemaName);
    formTester.setValue("content:details:form:type:dropDownChoiceField", "0");
    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();
    // delete plain schema
    TESTER.clickLink(PLAIN_DATATABLE_PATH + ":tablePanel:groupForm:checkgroup:dataTable:bottomToolbars:toolbars:3:span:navigator:last");
    TESTER.assertComponent(PLAIN_DATATABLE_PATH, AjaxDataTablePanel.class);
    Component result = findComponentByProp(KEY, PLAIN_DATATABLE_PATH, schemaName);
    assertNotNull(result);
    TESTER.executeAjaxEvent(result.getPageRelativePath(), Constants.ON_CLICK);
    TESTER.getRequest().addParameter("confirm", "true");
    TESTER.clickLink("body:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:outerObjectsRepeater:1:outer:" + "container:content:togglePanelContainer:container:actions:actions:actionRepeater:1:action:action");
    TESTER.executeAjaxEvent(TESTER.getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:accordionPanel:tabs:0:body:content:outerObjectsRepeater:1:outer:" + "container:content:togglePanelContainer:container:actions:actions:actionRepeater:1:action:action"), Constants.ON_CLICK);
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();
    assertNull(findComponentByProp(KEY, PLAIN_DATATABLE_PATH, schemaName));
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 62 with FormTester

use of org.apache.wicket.util.tester.FormTester in project syncope by apache.

the class SchemasITCase method createVirtualSchema.

@Test
public void createVirtualSchema() {
    browsingToVirtualSchemas();
    TESTER.clickLink("body:content:tabbedPanel:panel:accordionPanel:tabs:2:body:content:container:content:add");
    TESTER.assertComponent("body:content:tabbedPanel:panel:accordionPanel:tabs:2:body:content:outerObjectsRepeater:0:outer", Modal.class);
    final FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:" + "accordionPanel:tabs:2:body:content:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:details:form:resource:dropDownChoiceField", "0");
    TESTER.executeAjaxEvent("body:content:tabbedPanel:panel:" + "accordionPanel:tabs:2:body:content:outerObjectsRepeater:0:outer:form:" + "content:details:form:resource:dropDownChoiceField", Constants.ON_CHANGE);
    formTester.setValue("content:details:form:key:textField", "mynewvir");
    formTester.setValue("content:details:form:resource:dropDownChoiceField", "0");
    formTester.setValue("content:details:form:anyType:dropDownChoiceField", "0");
    formTester.setValue("content:details:form:extAttrName:textField", "virattr");
    TESTER.executeAjaxEvent("body:content:tabbedPanel:panel:accordionPanel:tabs:2:body:content:" + "outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit", Constants.ON_CLICK);
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();
    TESTER.assertRenderedPage(Types.class);
    Component result = findComponentByProp(KEY, VIRTUAL_DATATABLE_PATH, "mynewvir");
    TESTER.executeAjaxEvent(result.getPageRelativePath(), Constants.ON_CLICK);
    TESTER.getRequest().addParameter("confirm", "true");
    TESTER.clickLink("body:content:tabbedPanel:panel:accordionPanel:tabs:2:body:content:outerObjectsRepeater:1:outer:" + "container:content:togglePanelContainer:container:actions:actions:actionRepeater:1:action:action");
    TESTER.executeAjaxEvent(TESTER.getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:accordionPanel:tabs:2:body:content:outerObjectsRepeater:1:outer:" + "container:content:togglePanelContainer:container:actions:actions:actionRepeater:1:action:action"), Constants.ON_CLICK);
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();
    assertNull(findComponentByProp(KEY, VIRTUAL_DATATABLE_PATH, "mynewvir"));
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 63 with FormTester

use of org.apache.wicket.util.tester.FormTester in project syncope by apache.

the class RelationshipTypesITCase method update.

@Test
public void update() {
    final String name = "relationshipTypeUpdate";
    createRelationshipType(name);
    browsingToRelationshipType();
    Component result = findComponentByProp(KEY, DATATABLE_PATH, name);
    assertNotNull(result);
    TESTER.executeAjaxEvent(result.getPageRelativePath(), Constants.ON_CLICK);
    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:relationshipTypeDetails:container:form:description:textField", "new description");
    TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
    TESTER.assertInfoMessages("Operation executed successfully");
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 64 with FormTester

use of org.apache.wicket.util.tester.FormTester in project syncope by apache.

the class RolesITCase method createRole.

private void createRole(final String name) {
    TESTER.clickLink("body:content:tabbedPanel:panel:container:content:add");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);
    FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:form:view:key:textField", name);
    formTester.submit("content:form:buttons:next");
    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:form:view:entitlements:paletteField:recorder", "WORKFLOW_DEF_READ,NOTIFICATION_UPDATE,RELATIONSHIPTYPE_READ,RELATIONSHIPTYPE_LIST");
    formTester.submit("content:form:buttons:next");
    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.submit("content:form:buttons:next");
    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.submit("content:form:buttons:next");
    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.submit("content:form:buttons:finish");
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();
    TESTER.clickLink("body:configurationLI:configurationUL:securityLI:security");
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester)

Example 65 with FormTester

use of org.apache.wicket.util.tester.FormTester in project syncope by apache.

the class SecurityQuestionsITCase method update.

@Test
public void update() {
    createSecurityQuestion("What's your preferred color?");
    Component result = findComponentByProp("content", "body:content:tabbedPanel:panel:container:content:" + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "What's your preferred color?");
    assertNotNull(result);
    TESTER.executeAjaxEvent(result.getPageRelativePath(), Constants.ON_CLICK);
    TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:1:outer:container:content:" + "togglePanelContainer:container:actions:actions:actionRepeater:0:action:action");
    FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:securityQuestionDetailsPanel:container:form:content:textField", "What's your preferred car?");
    TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Aggregations

FormTester (org.apache.wicket.util.tester.FormTester)207 Test (org.junit.Test)122 Test (org.junit.jupiter.api.Test)54 Component (org.apache.wicket.Component)50 WicketTester (org.apache.wicket.util.tester.WicketTester)14 AbstractInitializedGuiIntegrationTest (com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest)9 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)9 Test (org.testng.annotations.Test)9 List (java.util.List)8 ListModel (org.apache.wicket.model.util.ListModel)7 ArrayList (java.util.ArrayList)6 File (org.apache.wicket.util.file.File)4 OrgType (com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType)3 ButtonAjaxBehavior (com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior)3 LocalDate (java.time.LocalDate)3 Cookie (javax.servlet.http.Cookie)3 Page (org.apache.wicket.Page)3 LocalDateConverter (org.apache.wicket.util.convert.converter.LocalDateConverter)3 Ignore (org.junit.Ignore)3 RoleType (com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType)2