Search in sources :

Example 76 with FormTester

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

the class AnyTypesITCase method create.

@Test
public void create() {
    browsingToAnyTypes();
    final String anyTypeTest = "anyTypeTest2";
    TESTER.clickLink("body:content:tabbedPanel:panel:container:content:add");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);
    final FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:anyTypeDetailsPanel:container:form:key:textField", anyTypeTest);
    formTester.setValue("content:anyTypeDetailsPanel:container:form:classes:paletteField:recorder", "csv");
    TESTER.clearFeedbackMessages();
    TESTER.clickLink("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.clearFeedbackMessages();
    TESTER.assertRenderedPage(Types.class);
    TESTER.clickLink("body:content:tabbedPanel:tabs-container:tabs:1:link");
    TESTER.assertComponent(DATATABLE_PATH, AjaxDataTablePanel.class);
    Component component = findComponentByProp(KEY, DATATABLE_PATH, anyTypeTest);
    TESTER.assertLabel(component.getPageRelativePath() + ":cells:1:cell", anyTypeTest);
    TESTER.assertLabel(component.getPageRelativePath() + ":cells:3:cell", "[csv]");
    // issue SYNCOPE-1111
    TESTER.clickLink("body:realmsLI:realms");
    TESTER.assertRenderedPage(Realms.class);
    TESTER.assertLabel("body:content:body:container:content:tabbedPanel:tabs-container:tabs:4:link:title", anyTypeTest);
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 77 with FormTester

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

the class BulkActionITCase method userResourceBulkAction.

@Test
public void userResourceBulkAction() {
    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", "rossini");
    assertNotNull(component);
    TESTER.executeAjaxEvent(component.getPageRelativePath(), Constants.ON_CLICK);
    // manage resource
    TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:1" + ":outer:container:content:togglePanelContainer:container:actions:actions:actionRepeater:5:" + "action:action");
    TESTER.assertComponent(TAB_PANEL + "outerObjectsRepeater:2:outer:form:content:status:" + "firstLevelContainer:first:container:content:searchContainer:resultTable:tablePanel:groupForm:" + "checkgroup:dataTable", WebMarkupContainer.class);
    component = findComponentByProp("resource", TAB_PANEL + "outerObjectsRepeater:2:outer:form:content:status:" + "firstLevelContainer:first:container:content:searchContainer:resultTable:tablePanel:groupForm:" + "checkgroup:dataTable", "resource-csv");
    assertNotNull(component);
    FormTester formTester = TESTER.newFormTester(TAB_PANEL + "outerObjectsRepeater:2:outer:form:content:status:firstLevelContainer:" + "first:container:content:searchContainer:resultTable:tablePanel:groupForm");
    assertNotNull(formTester);
    formTester.select("checkgroup", 2);
    TESTER.executeAjaxEvent(TAB_PANEL + "outerObjectsRepeater:2:outer:form:content:status:" + "firstLevelContainer:first:container:content:searchContainer:resultTable:tablePanel:bulkActionLink", Constants.ON_CLICK);
    TESTER.assertComponent(TAB_PANEL + "outerObjectsRepeater:2:outer:form:content:status:" + "secondLevelContainer:second:container", WebMarkupContainer.class);
    assertNotNull(findComponentByProp("resource", TAB_PANEL + "outerObjectsRepeater:2:outer:" + "form:content:status:secondLevelContainer:second:container", "resource-csv"));
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 78 with FormTester

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

the class BulkActionITCase method executePropagationTask.

@Test
public void executePropagationTask() {
    TESTER.clickLink("body:topologyLI:topology");
    Component component = findComponentByProp("key", "body:resources", "resource-testdb");
    assertNotNull(component);
    TESTER.executeAjaxEvent(component.getPageRelativePath() + ":res", Constants.ON_CLICK);
    TESTER.clickLink("body:toggle:container:content:togglePanelContainer:container:actions:propagation");
    FormTester formTester = TESTER.newFormTester("body:toggle:outerObjectsRepeater:1:outer:form:content:tasks:firstLevelContainer:first:container:" + "content:searchContainer:resultTable:tablePanel:groupForm");
    assertNotNull(formTester);
    formTester.select("checkgroup", 0);
    TESTER.executeAjaxEvent("body:toggle:outerObjectsRepeater:1:outer:form:content:tasks:" + "firstLevelContainer:first:container:content:searchContainer:resultTable:tablePanel:bulkActionLink", Constants.ON_CLICK);
    TESTER.assertComponent("body:toggle:outerObjectsRepeater:1:outer:form:content:tasks:secondLevelContainer:" + "second:container:selectedObjects:body:rows:1:cells:1:cell", Label.class);
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 79 with FormTester

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

the class BulkActionITCase method usersBulkAction.

@Test
public void usersBulkAction() {
    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", "rossini");
    assertNotNull(component);
    FormTester formTester = TESTER.newFormTester(CONTAINER + "searchContainer:resultTable:tablePanel:groupForm");
    assertNotNull(formTester);
    formTester.select("checkgroup", 2);
    TESTER.executeAjaxEvent(CONTAINER + "searchContainer:resultTable:tablePanel:bulkActionLink", Constants.ON_CLICK);
    TESTER.assertComponent(CONTAINER + "searchContainer:resultTable:bulkModal:form:content:content:container", WebMarkupContainer.class);
    assertNotNull(findComponentByProp("username", CONTAINER + "searchContainer:resultTable:bulkModal:form:content:content:container", "rossini"));
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 80 with FormTester

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

the class DisplayAttributesITCase method readAndSet.

@Test
public void readAndSet() {
    TESTER.clickLink("body:content:body:container:content:tabbedPanel:tabs-container:tabs:3:link");
    TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:searchResult:container:content:" + "searchContainer:tablehandling:actionRepeater:1:action:action");
    TESTER.assertComponent("body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:3:outer", Modal.class);
    FormTester formTester = TESTER.newFormTester("body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:3:outer:form");
    formTester.setValue("content:container:details:paletteField:recorder", "status");
    TESTER.clickLink("body:content:body:container:content:tabbedPanel:panel:searchResult:outerObjectsRepeater:" + "3:outer:dialog:footer:inputs:0:submit");
    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.clearFeedbackMessages();
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) 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