Search in sources :

Example 1 with CarouselEditDialog

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog 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 2 with CarouselEditDialog

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class CarouselIT method testReorderItem.

/**
 * Test: Edit Dialog : Reorder items
 *
 * 1. create new items with titles
 * 2. open the edit dialog
 * 3. move the last item before the first one
 * 4. save the edit dialog
 * 5. open the edit dialog
 * 6. verify the new order
 * 7. verify the expanded items select
 * 8. save the edit dialog
 */
@Test
@DisplayName("Test: Edit Dialog : Reorder items")
public void testReorderItem() throws InterruptedException {
    createItems();
    CarouselEditDialog editDialog = carousel.openEditDialog(cmpPath);
    ChildrenEditor childrenEditor = editDialog.getChildrenEditor();
    childrenEditor.moveItems(2, 0);
    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("item2") || items.get(0).getValue().equals("item0"), "First input item should be item2 or item0");
    assertTrue(items.get(1).getValue().equals("item0") || items.get(1).getValue().equals("item2"), "Second input item should be item0 or item2  ");
    assertTrue(items.get(2).getValue().equals("item1"), "Second input item should be item1");
    Commons.saveConfigureDialog();
}
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) AuthorBaseUITest(com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 3 with CarouselEditDialog

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class CarouselIT method testAutoplayGroup.

@Test
@DisplayName("Test: Autoplay group toggle")
public void testAutoplayGroup() throws InterruptedException {
    createItems();
    CarouselEditDialog editDialog = carousel.openEditDialog(cmpPath);
    editDialog.openEditDialogProperties();
    CoralCheckbox autoplay = editDialog.getAutoplay();
    assertTrue(autoplay.isChecked() == false, "Autoplay should be unchecked");
    assertTrue(editDialog.getAutoplayGroup().isDisplayed() == false, "Autoplay Group should not be visible");
    autoplay.setSelected(true);
    assertTrue(editDialog.getAutoplayGroup().isDisplayed() == true, "Autoplay Group should be visible");
    autoplay.setSelected(false);
    assertTrue(editDialog.getAutoplayGroup().isDisplayed() == false, "Autoplay Group should not be visible");
}
Also used : CarouselEditDialog(com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog) CoralCheckbox(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox) AuthorBaseUITest(com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 4 with CarouselEditDialog

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class CarouselIT method testRemoveItem.

/**
 * Test: Edit Dialog : Remove items
 *
 * 1. create new items with titles
 * 2. open the edit dialog
 * 3. remove the first item and save the edit dialog
 * 4. open the edit dialog
 * 5. verify that the first item has been removed
 * 6. verify the expanded items select
 * 7. save the edit dialog
 */
@Test
@DisplayName("Test: Edit Dialog : Remove items")
public void testRemoveItem() throws InterruptedException {
    createItems();
    CarouselEditDialog editDialog = carousel.openEditDialog(cmpPath);
    ChildrenEditor childrenEditor = editDialog.getChildrenEditor();
    childrenEditor.removeFirstItem();
    Commons.saveConfigureDialog();
    carousel.openEditDialog(cmpPath);
    ElementsCollection items = childrenEditor.getInputItems();
    assertTrue(items.size() == 2, "Number to items added should be 2");
    assertTrue(items.get(0).getValue().equals("item1"), "First input item should be item1");
    assertTrue(items.get(1).getValue().equals("item2"), "Second input item should be item2");
    Commons.saveConfigureDialog();
}
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) AuthorBaseUITest(com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

CarouselEditDialog (com.adobe.cq.wcm.core.components.it.seljup.util.components.carousel.CarouselEditDialog)4 AuthorBaseUITest (com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest)3 ChildrenEditor (com.adobe.cq.wcm.core.components.it.seljup.util.components.commons.ChildrenEditor)3 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 DisplayName (org.junit.jupiter.api.DisplayName)3 Test (org.junit.jupiter.api.Test)3 CoralCheckbox (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralCheckbox)1 InsertComponentDialog (com.adobe.cq.testing.selenium.pagewidgets.cq.InsertComponentDialog)1