use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect 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);
}
use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect 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);
}
use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect 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;
}
use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect 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);
}
use of com.adobe.cq.testing.selenium.pagewidgets.coral.CoralSelect 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);
}
}
Aggregations