use of org.openqa.selenium.support.ui.Select in project zeppelin by apache.
the class InterpreterIT method testShowDescriptionOnInterpreterCreate.
@Test
public void testShowDescriptionOnInterpreterCreate() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
try {
// navigate to interpreter page
WebElement settingButton = driver.findElement(By.xpath("//button[@class='nav-btn dropdown-toggle ng-scope']"));
settingButton.click();
WebElement interpreterLink = driver.findElement(By.xpath("//a[@href='#/interpreter']"));
interpreterLink.click();
WebElement createButton = driver.findElement(By.xpath("//button[contains(., 'Create')]"));
createButton.click();
Select select = new Select(driver.findElement(By.xpath("//select[@ng-change='newInterpreterGroupChange()']")));
select.selectByVisibleText("spark");
collector.checkThat("description of interpreter property is displayed", driver.findElement(By.xpath("//tr/td[contains(text(), 'spark.app.name')]/following-sibling::td[2]")).getText(), CoreMatchers.equalTo("The name of spark application."));
} catch (Exception e) {
handleException("Exception in InterpreterIT while testShowDescriptionOnInterpreterCreate ", e);
}
}
use of org.openqa.selenium.support.ui.Select in project zeppelin by apache.
the class ParagraphActionsIT method testWidth.
@Test
public void testWidth() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
try {
createNewNote();
waitForParagraph(1, "READY");
collector.checkThat("Default Width is 12 ", driver.findElement(By.xpath("//div[contains(@class,'col-md-12')]")).isDisplayed(), CoreMatchers.equalTo(true));
for (Integer newWidth = 1; newWidth <= 11; newWidth++) {
clickAndWait(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']"));
String visibleText = newWidth.toString();
new Select(driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a/form/select[(@ng-model='paragraph.config.colWidth')]"))).selectByVisibleText(visibleText);
collector.checkThat("New Width is : " + newWidth, driver.findElement(By.xpath("//div[contains(@class,'col-md-" + newWidth + "')]")).isDisplayed(), CoreMatchers.equalTo(true));
}
deleteTestNotebook(driver);
} catch (Exception e) {
handleException("Exception in ParagraphActionsIT while testWidth ", e);
}
}
use of org.openqa.selenium.support.ui.Select in project java.webdriver by sayems.
the class MultiSelect method isTextPresentInTheDropdown.
public boolean isTextPresentInTheDropdown(Supplier<By> by, String text) {
final Element element = untilFound(by);
Select dropdown = new Select(element);
return dropdown.getOptions().parallelStream().anyMatch(opt -> opt.getText().contains(text));
}
use of org.openqa.selenium.support.ui.Select in project java.webdriver by sayems.
the class MultiSelect method selectByIndex.
public MultiSelect selectByIndex(Supplier<By> by, Integer... indices) {
Select select = new Select(findElement(by));
select.deselectAll();
Arrays.stream(indices).forEach(select::selectByIndex);
return this;
}
use of org.openqa.selenium.support.ui.Select in project java.webdriver by sayems.
the class Action method selectDropdown.
// Method to select value from drop down based on visible text
public void selectDropdown(Supplier<By> by, String value) {
WebElement locator = driver.findElement(by.get());
Select dropdown = new Select(locator);
dropdown.selectByVisibleText(value);
}
Aggregations