Search in sources :

Example 6 with CoralSelectList

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

the class ContentFragmentListEditDialog 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)

Example 7 with CoralSelectList

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

the class TitleEditDialog method isTitleTypesPresent.

public boolean isTitleTypesPresent(String[] sizes) throws InterruptedException {
    openTitleTypeList();
    boolean present = true;
    for (int i = 0; i < sizes.length; i++) {
        if (!$(String.format(titleWithSize, sizes[i])).isDisplayed()) {
            present = false;
        }
    }
    CoralSelectList coralSelectList = getTitleTypeSelectList();
    coralSelectList.items().first().click();
    return present;
}
Also used : CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList)

Example 8 with CoralSelectList

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

the class TitleEditDialog method isTitleTypePresent.

public boolean isTitleTypePresent(String size) throws InterruptedException {
    openTitleTypeList();
    CoralSelectList coralSelectList = getTitleTypeSelectList();
    boolean present = false;
    for (int i = 0; i < coralSelectList.items().size(); i++) {
        if (coralSelectList.items().get(i).getValue().trim().equals("h" + size)) {
            present = true;
        }
    }
    // click default
    coralSelectList.items().first().click();
    return present;
}
Also used : CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList)

Example 9 with CoralSelectList

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

the class FormContainerEditDialog method selectActionType.

public void selectActionType(String action) {
    // Open selectlist
    $("[name='./actionType'] > button").click();
    CoralSelectList coralSelectList = new CoralSelectList($("[name='./actionType']"));
    if (!coralSelectList.isVisible()) {
        CoralSelect selectList = new CoralSelect("name='./actionType'");
        coralSelectList = selectList.openSelectList();
    }
    final WebDriver webDriver = WebDriverRunner.getWebDriver();
    WebElement element = webDriver.findElement(By.cssSelector("coral-selectlist-item[value='" + action + "']"));
    ((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView(true);", element);
    coralSelectList.selectByValue(action);
}
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 10 with CoralSelectList

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

the class Page method setRobotsTags.

public void setRobotsTags(String... values) {
    CoralSelect selectList = new CoralSelect(robotsTags);
    CoralSelectList coralSelectList = selectList.openSelectList();
    for (String value : values) {
        coralSelectList.selectByValue(value);
    }
}
Also used : CoralSelect(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect) 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