Search in sources :

Example 1 with CoralSelectList

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

the class Commons method useDialogSelect.

public static void useDialogSelect(String name, String value) throws InterruptedException {
    $("[name='" + name + "'] > button").click();
    Commons.webDriverWait(RequestConstants.WEBDRIVER_WAIT_TIME_MS);
    CoralSelectList coralSelectList = new CoralSelectList($("[name='" + name + "']"));
    if (!coralSelectList.isVisible()) {
        CoralSelect selectList = new CoralSelect("name='" + name + "'");
        coralSelectList = selectList.openSelectList();
    }
    final WebDriver webDriver = WebDriverRunner.getWebDriver();
    WebElement element = webDriver.findElement(By.cssSelector("coral-selectlist-item[value='" + value + "']"));
    ((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView(true);", element);
    coralSelectList.selectByValue(value);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) JavascriptExecutor(org.openqa.selenium.JavascriptExecutor) WebElement(org.openqa.selenium.WebElement) CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList) CoralSelect(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect)

Example 2 with CoralSelectList

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

the class AccordionIT method selectExpandedItem.

/**
 * Create and title a single accordion item
 *
 * @param idx id of the item to be expanded
 *
 * 1. open the edit dialog
 * 2. open the properties tab
 * 3. open the expandedselect list
 * 4. select the idx item
 * 5. save the edit dialog
 *
 * @throws InterruptedException
 */
private CoralSelectList selectExpandedItem(int idx) throws InterruptedException {
    // 1.
    AccordionEditDialog editDialog = accordion.openEditDialog(cmpPath);
    // 2.
    AccordionEditDialog.EditDialogProperties properties = editDialog.getEditDialogProperties();
    properties.openProperties();
    // 3.
    properties.openExpandedSelect(" > button");
    // 4.
    CoralSelectList selectedItems = properties.selectList();
    selectedItems.selectByIndex(idx);
    // 5.
    Commons.saveConfigureDialog();
    return selectedItems;
}
Also used : AccordionEditDialog(com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog) CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList)

Example 3 with CoralSelectList

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

the class FormTextEditDialog 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);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) JavascriptExecutor(org.openqa.selenium.JavascriptExecutor) WebElement(org.openqa.selenium.WebElement) CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList) CoralSelect(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect)

Example 4 with CoralSelectList

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

the class FormTextEditDialog method checkAllConstraintsAvailable.

public boolean checkAllConstraintsAvailable() {
    $("[name='./type'] > button").click();
    CoralSelectList coralSelectList = new CoralSelectList($("[name='./type']"));
    if (!coralSelectList.isVisible()) {
        CoralSelect selectList = new CoralSelect("name='./type'");
        coralSelectList = selectList.openSelectList();
    }
    String[] constraints = { "text", "textarea", "email", "tel", "date", "number", "password" };
    Boolean present = true;
    for (int i = 0; i < constraints.length; i++) {
        if (!coralSelectList.getItemByValue(constraints[i]).isDisplayed())
            present = false;
    }
    return present;
}
Also used : CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList) CoralSelect(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect)

Example 5 with CoralSelectList

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

the class ContentFragmentEditDialog method addElement.

public void addElement(String value) {
    $("[coral-multifield-add]").click();
    $$("coral-multifield-item").last().$(elementNameSelectButton).click();
    CoralSelectList coralSelectList = new CoralSelectList($$("coral-multifield-item").last().$("coral-select[name='./elementNames']"));
    if (!coralSelectList.isVisible()) {
        CoralPopOver popOver = CoralPopOver.firstOpened();
        popOver.waitVisible();
        Helpers.waitForElementAnimationFinished(popOver.getCssSelector());
        coralSelectList = new CoralSelectList(popOver.element());
    }
    final WebDriver webDriver = WebDriverRunner.getWebDriver();
    WebElement element = webDriver.findElement(By.cssSelector("coral-selectlist-item[value='" + value + "']"));
    ((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView(true);", element);
    coralSelectList.selectByValue(value);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) CoralPopOver(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralPopOver) JavascriptExecutor(org.openqa.selenium.JavascriptExecutor) WebElement(org.openqa.selenium.WebElement) CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList)

Aggregations

CoralSelectList (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList)15 CoralSelect (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect)7 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)7 WebDriver (org.openqa.selenium.WebDriver)7 WebElement (org.openqa.selenium.WebElement)7 CoralPopOver (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralPopOver)3 AccordionEditDialog (com.adobe.cq.wcm.core.components.it.seljup.util.components.accordion.AccordionEditDialog)2 AuthorBaseUITest (com.adobe.cq.wcm.core.components.it.seljup.AuthorBaseUITest)1 ArrayList (java.util.ArrayList)1 DisplayName (org.junit.jupiter.api.DisplayName)1 Test (org.junit.jupiter.api.Test)1