Search in sources :

Example 1 with InsertComponentDialog

use of com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class AccordionIT method createItem.

/**
 * Create three items via the children editor
 *
 * 1. open the edit dialog
 * 2. add item via the children editor
 * 3. save the edit dialog
 * 4. Check if items are added
 *
 * @throws InterruptedException
 */
private ElementsCollection createItem() throws InterruptedException {
    // 1.
    AccordionEditDialog editDialog = accordion.openEditDialog(cmpPath);
    editDialog.openItemsTab();
    // 2.
    ChildrenEditor childrenEditor = editDialog.getChildrenEditor();
    childrenEditor.clickAddButton();
    InsertComponentDialog insertComponentDialog = editDialog.getInsertComponentDialog();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item0");
    childrenEditor.clickAddButton();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item1");
    childrenEditor.clickAddButton();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item2");
    // 3.
    Commons.saveConfigureDialog();
    // 4.
    accordion.openEditDialog(cmpPath);
    editDialog.openItemsTab();
    ElementsCollection items = childrenEditor.getInputItems();
    assertTrue(items.size() == 3, "Number to items added should be 3");
    assertTrue(items.get(0).getValue().equals("item0"), "First input item should be item0");
    assertTrue(items.get(1).getValue().equals("item1"), "Second input item should be item1");
    assertTrue(items.get(2).getValue().equals("item2"), "Third input item should be item2");
    Commons.saveConfigureDialog();
    return items;
}
Also used : ChildrenEditor(com.adobe.cq.wcm.core.components.it.seljup.util.components.commons.ChildrenEditor) ElementsCollection(com.codeborne.selenide.ElementsCollection) AccordionEditDialog(com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog) InsertComponentDialog(com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog)

Example 2 with InsertComponentDialog

use of com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class CarouselIT method createItems.

/**
 * Create three items via the children editor
 *
 * 1. open the edit dialog
 * 2. add item via the children editor
 * 3. save the edit dialog
 */
private ElementsCollection createItems() throws InterruptedException {
    CarouselEditDialog editDialog = carousel.openEditDialog(cmpPath);
    ChildrenEditor childrenEditor = editDialog.getChildrenEditor();
    childrenEditor.clickAddButton();
    InsertComponentDialog insertComponentDialog = editDialog.getInsertComponentDialog();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item0");
    childrenEditor.clickAddButton();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item1");
    childrenEditor.clickAddButton();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item2");
    Commons.saveConfigureDialog();
    carousel.openEditDialog(cmpPath);
    ElementsCollection items = childrenEditor.getInputItems();
    assertTrue(items.size() == 3, "Number to items added should be 3");
    assertTrue(items.get(0).getValue().equals("item0"), "First input item should be item0");
    assertTrue(items.get(1).getValue().equals("item1"), "Second input item should be item1");
    assertTrue(items.get(2).getValue().equals("item2"), "Third input item should be item2");
    Commons.saveConfigureDialog();
    return items;
}
Also used : ChildrenEditor(com.adobe.cq.wcm.core.components.it.seljup.util.components.commons.ChildrenEditor) ElementsCollection(com.codeborne.selenide.ElementsCollection) CarouselEditDialog(com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog) InsertComponentDialog(com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog)

Example 3 with InsertComponentDialog

use of com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class TabsIT method createItems.

/**
 * Create three items via the children editor
 *
 * 1. open the edit dialog
 * 2. add item via the children editor
 * 3. save the edit dialog
 * 4. Check if items are added
 *
 * @throws InterruptedException
 */
private ElementsCollection createItems() throws InterruptedException {
    // 1.
    TabsEditDialog editDialog = tabs.openEditDialog(cmpPath);
    editDialog.openItemsTab();
    // 2.
    ChildrenEditor childrenEditor = editDialog.getChildrenEditor();
    childrenEditor.clickAddButton();
    InsertComponentDialog insertComponentDialog = editDialog.getInsertComponentDialog();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item0");
    childrenEditor.clickAddButton();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item1");
    childrenEditor.clickAddButton();
    insertComponentDialog.selectComponent("/libs/wcm/foundation/components/responsivegrid");
    childrenEditor.getInputItems().last().sendKeys("item2");
    // 3.
    Commons.saveConfigureDialog();
    // 4.
    tabs.openEditDialog(cmpPath);
    editDialog.openItemsTab();
    ElementsCollection items = childrenEditor.getInputItems();
    assertTrue(items.size() == 3, "Number to items added should be 3");
    assertTrue(items.get(0).getValue().equals("item0"), "First input item should be item0");
    assertTrue(items.get(1).getValue().equals("item1"), "Second input item should be item1");
    assertTrue(items.get(2).getValue().equals("item2"), "Third input item should be item2");
    Commons.saveConfigureDialog();
    return items;
}
Also used : ChildrenEditor(com.adobe.cq.wcm.core.components.it.seljup.util.components.commons.ChildrenEditor) ElementsCollection(com.codeborne.selenide.ElementsCollection) TabsEditDialog(com.adobe.cq.wcm.core.components.it.seljup.util.components.tabs.TabsEditDialog) InsertComponentDialog(com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog)

Aggregations

InsertComponentDialog (com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog)3 ChildrenEditor (com.adobe.cq.wcm.core.components.it.seljup.util.components.commons.ChildrenEditor)3 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 AccordionEditDialog (com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog)1 CarouselEditDialog (com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog)1 TabsEditDialog (com.adobe.cq.wcm.core.components.it.seljup.util.components.tabs.TabsEditDialog)1