Search in sources :

Example 71 with FormTester

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");
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester)

Example 72 with FormTester

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();
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester)

Example 73 with FormTester

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());
}
Also used : AjaxPalettePanel(org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel) FormTester(org.apache.wicket.util.tester.FormTester) Test(org.junit.jupiter.api.Test)

Example 74 with FormTester

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);
}
Also used : FormTester(org.apache.wicket.util.tester.FormTester) Component(org.apache.wicket.Component) Test(org.junit.jupiter.api.Test)

Example 75 with FormTester

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);
}
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