Search in sources :

Example 1 with CoralPopOver

use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralPopOver 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)

Example 2 with CoralPopOver

use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralPopOver 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 3 with CoralPopOver

use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralPopOver 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());
    }
}
Also used : CoralPopOver(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralPopOver) CoralSelectList(com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList)

Aggregations

CoralPopOver (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralPopOver)3 CoralSelectList (com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelectList)3 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)2 WebDriver (org.openqa.selenium.WebDriver)2 WebElement (org.openqa.selenium.WebElement)2