use of com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class AccordionIT method testAddItem.
/**
* Test: Edit Dialog: Add items
*
* 1. create new items with titles
* 4. verify the expanded items select
* 5. save the edit dialog
*
* @throws InterruptedException
*/
@Test
@DisplayName("Test: Edit Dialog: Add items")
public void testAddItem() throws InterruptedException {
// 1.
ElementsCollection items = createItem();
// 2.
AccordionEditDialog editDialog = accordion.openEditDialog(cmpPath);
verifyExpandedItemsSelect(items, editDialog.getEditDialogProperties());
// 3.
Commons.saveConfigureDialog();
}
use of com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class AccordionIT method testSetExpandedItems.
/**
* Test: Edit Dialog : Set expanded items
*
* 1. create new items with titles
* 2. set the second item expanded
* 3. verify the second item is expanded
* 4. open the edit dialog
* 5. switch to the properties tab and also set the third item expanded
* 6. save the edit dialog
* 7. verify both second and third items are expanded
*
* @throws InterruptedException
*/
@Test
@DisplayName("Test: Edit Dialog : Set expanded items")
public void testSetExpandedItems() throws InterruptedException {
// 1.
createItem();
// 2.
selectExpandedItem(1);
// 3.
ArrayList<String> items = new ArrayList<>();
items.add("item1");
verifyExpandedItems(items);
// 4.
AccordionEditDialog editDialog = accordion.openEditDialog(cmpPath);
// 5.
AccordionEditDialog.EditDialogProperties properties = editDialog.getEditDialogProperties();
properties.openProperties();
properties.openExpandedSelect(" > button");
CoralSelectList selectedItems = properties.selectList();
selectedItems.selectByIndex(2);
// 6.
Commons.saveConfigureDialog();
// wait for configuration changes to reflect
Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
// 7.
items.clear();
items.add("item1");
items.add("item2");
verifyExpandedItems(items);
}
use of com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class AccordionIT method testSingleItemExpansion.
/**
* Test: Edit Dialog : Single item expansion
*
* 1. create new items with titles
* 2. open the edit dialog
* 3. switch to the properties tab
* 4. verify that the expanded items select is enabled, expanded item select is disabled and single item expansion disabled.
* 5. enable single item expansion
* 6. verify that the expanded items select is disabled and expanded item select is enabled.
* 7. save the edit dialog
* 8. verify that the first item is expanded
*
* @throws InterruptedException
*/
@Test
@DisplayName("Test: Edit Dialog : Single item expansion")
public void testSingleItemExpansion() throws InterruptedException {
// 1.
createItem();
// 2.
AccordionEditDialog editDialog = accordion.openEditDialog(cmpPath);
AccordionEditDialog.EditDialogProperties properties = editDialog.getEditDialogProperties();
// 3.
properties.openProperties();
// 4.
CoralCheckbox singleExpansion = properties.getSingleExpansion();
assertTrue(singleExpansion.isChecked() == false, "SingleExpansion should not be checked");
assertTrue(properties.isExpandedSelectVisible() == true, "Expanded select should be visible");
assertTrue(properties.isExpandedSelectDisabled() == false, "Expanded select should not be disabled");
assertTrue(properties.isExpandedSelectSingleVisible() == false, "Expanded select single should not be visible");
assertTrue(properties.isExpandedSelectSingleDisabled() == true, "Expanded select single should be disabled");
// 5.
singleExpansion.setSelected(true);
// 6.
assertTrue(singleExpansion.isChecked() == true, "SingleExpansion should be checked");
assertTrue(properties.isExpandedSelectVisible() == false, "Expanded select should not be visible");
assertTrue(properties.isExpandedSelectDisabled() == true, "Expanded select should be disabled");
assertTrue(properties.isExpandedSelectSingleVisible() == true, "Expanded select single should be visible");
assertTrue(properties.isExpandedSelectSingleDisabled() == false, "Expanded select single should not be disabled");
// 7.
Commons.saveConfigureDialog();
// 8.
ArrayList<String> items = new ArrayList<>();
items.add("item0");
verifyExpandedItems(items);
}
Aggregations