Search in sources :

Example 66 with FormTester

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

the class SecurityQuestionsITCase method createSecurityQuestion.

private void createSecurityQuestion(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:securityQuestionDetailsPanel:container:form:content:textField", name);
    TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();
    TESTER.clickLink("body:configurationLI:configurationUL:securityLI:security");
    TESTER.clickLink("body:content:tabbedPanel:tabs-container:tabs:3:link");
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester)

Example 67 with FormTester

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

the class TopologyITCase method editPushTask.

@Test
public void editPushTask() {
    Component component = findComponentByProp("key", "body:resources", "resource-ldap");
    assertNotNull(component);
    TESTER.executeAjaxEvent(component.getPageRelativePath() + ":res", Constants.ON_CLICK);
    TESTER.clickLink("body:toggle:container:content:togglePanelContainer:container:actions:push");
    TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:2:outer:form:content:tasks:firstLevelContainer:" + "first:container:content:searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable:" + "body:rows:1", Constants.ON_CLICK);
    TESTER.clickLink("body:toggle:outerObjectsRepeater:2:outer:form:content:tasks:firstLevelContainer:first:" + "outerObjectsRepeater:1:outer:container:content:togglePanelContainer:container:" + "actions:actions:actionRepeater:1:action:action");
    FormTester formTester = TESTER.newFormTester("body:toggle:outerObjectsRepeater:2:outer:form:content:" + "tasks:firstLevelContainer:first:container:content:wizard:form");
    formTester.setValue("view:description:textField", "test");
    formTester.submit("buttons:next");
    TESTER.assertModelValue("body:toggle:outerObjectsRepeater:2:outer:form:content:tasks:" + "firstLevelContainer:first:container:content:wizard:form:view:filters:0:filters:tabs:0:body:" + "content:searchFormContainer:search:multiValueContainer:innerForm:content:view:0:panel:container:" + "value:textField", "_NO_ONE_");
    formTester = TESTER.newFormTester("body:toggle:outerObjectsRepeater:2:outer:form:content:" + "tasks:firstLevelContainer:first:container:content:wizard:form");
    formTester.submit("buttons:finish");
    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)

Example 68 with FormTester

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

the class TopologyITCase method editProvisioning.

@Test
public void editProvisioning() {
    Component component = findComponentByProp("key", "body:resources", "ws-target-resource-1");
    assertNotNull(component);
    TESTER.executeAjaxEvent(component.getPageRelativePath() + ":res", Constants.ON_CLICK);
    TESTER.clickLink("body:toggle:container:content:togglePanelContainer:container:actions:provision");
    TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:" + "content:group:beans:0:fields:0", Constants.ON_CLICK);
    TESTER.clickLink("body:toggle:outerObjectsRepeater:3:outer:form:content:toggle:container:content:" + "togglePanelContainer:container:actions:actions:actionRepeater:0:action:action");
    FormTester formTester = TESTER.newFormTester("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
    formTester.submit("buttons:next");
    formTester = TESTER.newFormTester("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:wizard:form");
    formTester.submit("buttons:next");
    TESTER.assertComponent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:" + "container:content:wizard:form:view:mapping:mappingContainer:mappings:1", WebMarkupContainer.class);
    TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:" + "content:wizard:form:view:mapping:mappingContainer:mappings:1:itemTransformers:icon", Constants.ON_CLICK);
    TESTER.clickLink("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:content:" + "wizard:form:view:mapping:mappingContainer:mappings:0:itemTransformers:alertsLink");
    TESTER.assertComponent("body:toggle:outerObjectsRepeater:3:outer:form:content:provision:container:" + "content:wizard:outerObjectsRepeater:0:outer:container:content:togglePanelContainer:" + "form:classes:paletteField", NonI18nPalette.class);
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 69 with FormTester

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

the class UsersITCase method editRelationships.

@Test
public void editRelationships() {
    TESTER.clickLink("body:realmsLI:realms");
    TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
    Component component = findComponentByProp("username", CONTAINER + ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini");
    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");
    TESTER.assertComponent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:username:textField", TextField.class);
    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");
    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.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:relationships:actions:" + "actionRepeater:0:action:action", Constants.ON_CLICK);
    formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form");
    assertNotNull(formTester);
    formTester.setValue("view:relationships:specification:type:dropDownChoiceField", "1");
    TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:relationships:" + "specification:type:dropDownChoiceField", Constants.ON_CHANGE);
    // The ON_CHANGE above should enable this component, but it doesn't; doing it by hand
    Component otherType = findComponentById(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:relationships:specification", "otherType");
    assertNotNull(otherType);
    otherType.setEnabled(true);
    formTester.setValue("view:relationships:specification:otherType:dropDownChoiceField", "PRINTER");
    TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:relationships:" + "specification:otherType:dropDownChoiceField", Constants.ON_CHANGE);
    component = findComponentByProp("name", TAB_PANEL + "outerObjectsRepeater:" + "0:outer:form:content:form:view:relationships:specification:searchPanelContainer:searchPanel:" + "searchResultPanel:container:content:searchContainer:resultTable:tablePanel:groupForm:checkgroup:" + "dataTable:body:rows:1:cells:2:cell", "Canon MF 8030cn");
    assertNotNull(component);
    formTester.submit("buttons:cancel");
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 70 with FormTester

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

the class UsersITCase method editUser.

@Test
public void editUser() {
    TESTER.clickLink("body:realmsLI:realms");
    TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:1:link");
    Component component = findComponentByProp("username", CONTAINER + ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini");
    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");
    TESTER.assertComponent(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:form:view:username:textField", TextField.class);
    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");
    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: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:1:field", Label.class);
    TESTER.clickLink(TAB_PANEL + "outerObjectsRepeater:0:outer:form:content:action:actionRepeater:0:action:action");
    component = findComponentByProp("username", CONTAINER + ":searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", "puccini");
    assertNotNull(component);
}
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