use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ButtonEditDialog method selectButtonType.
public void selectButtonType(String type) {
$("[name='./type'] > button").click();
CoralSelectList coralSelectList = new CoralSelectList($("[name='./type']"));
if (!coralSelectList.isVisible()) {
CoralSelect selectList = new CoralSelect("name='./type'");
coralSelectList = selectList.openSelectList();
}
final WebDriver webDriver = WebDriverRunner.getWebDriver();
WebElement element = webDriver.findElement(By.cssSelector("coral-selectlist-item[value='" + type + "']"));
((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView(true);", element);
coralSelectList.selectByValue(type);
}
use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class FormOptionsEditDialog method setOptionType.
/**
* Set the option type
*/
public void setOptionType(String optionType) {
// Open selectlist
$("[name='./type'] > button").click();
CoralSelectList coralSelectList = new CoralSelectList($("[name='./type']"));
if (!coralSelectList.isVisible()) {
CoralSelect selectList = new CoralSelect("name='./type'");
coralSelectList = selectList.openSelectList();
}
final WebDriver webDriver = WebDriverRunner.getWebDriver();
WebElement element = webDriver.findElement(By.cssSelector("coral-selectlist-item[value='" + optionType + "']"));
((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView(true);", element);
coralSelectList.selectByValue(optionType);
}
use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class AccordionIT method verifyExpandedItemsSelect.
/**
* Switches to the edit dialog properties tab and verifies the provided (ordered) expanded items exist
* in the expanded items select. Assumes the edit dialog is open.
*
* @param items list of items in component to be verified
* @param properties editdialog properties object
*
* 1. switch to the properties tab
* 2. open the expanded items select
* 3. verify the expanded items match those passed
*/
private void verifyExpandedItemsSelect(ElementsCollection items, AccordionEditDialog.EditDialogProperties properties) {
// 1.
properties.openProperties();
// 2.
properties.openExpandedSelect(" > button");
// 3.
CoralSelectList selectedItems = properties.selectList();
assertTrue(selectedItems.items().size() == items.size(), "Number of items in property config should be equal to added items number");
for (int i = 0; i < items.size(); i++) {
assertTrue(properties.getSelectedItemValue(i).contains(items.get(i).getValue()), "Selected item should be same as added item");
}
}
use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList 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.testing.selenium.pagewidgets.coral.CoralSelectList in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class TitleEditDialog method getTitleTypeSelectList.
/**
* @return list of the related coral popover that is opened.
*/
public CoralSelectList getTitleTypeSelectList() {
CoralSelectList coralSelectList = new CoralSelectList($(titleType));
if (coralSelectList.isVisible()) {
return coralSelectList;
} else {
CoralPopOver popOver = CoralPopOver.firstOpened();
popOver.waitVisible();
waitForElementAnimationFinished(popOver.getCssSelector());
return new CoralSelectList(popOver.element());
}
}
Aggregations