Add 1 more test to ensure the paragraph can be run with ENTER

This commit is contained in:
AhyoungRyu 2017-03-20 16:12:23 +09:00
parent 1a656db295
commit 77cc5c9ffb

View file

@ -262,7 +262,8 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
return;
}
try {
String xpathToCheckbox = getParagraphXPath(1) + "//ul/li/form/input[contains(@ng-checked, 'true')]";
String xpathToRunOnSelectionChangeCheckbox = getParagraphXPath(1) + "//ul/li/form/input[contains(@ng-checked, 'true')]";
String xpathToDropdownMenu = getParagraphXPath(1) + "//select";
String xpathToResultText = getParagraphXPath(1) + "//div[contains(@id,\"_html\")]";
createNewNote();
@ -278,7 +279,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/form/input[contains(@ng-click, 'turnOnAutoRun(paragraph)')]")).isDisplayed(),
CoreMatchers.equalTo(true));
Select dropDownMenu = new Select(driver.findElement(By.xpath((getParagraphXPath(1) + "//select"))));
Select dropDownMenu = new Select(driver.findElement(By.xpath((xpathToDropdownMenu))));
dropDownMenu.selectByVisibleText("2");
collector.checkThat("If 'RunOnSelectionChange' is true, the paragraph result will be updated right after click any options in the dropdown menu ",
driver.findElement(By.xpath(xpathToResultText)).getText(),
@ -286,17 +287,22 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
// 2. set 'RunOnSelectionChange' to false
driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click();
driver.findElement(By.xpath(xpathToCheckbox)).click();
driver.findElement(By.xpath(xpathToRunOnSelectionChangeCheckbox)).click();
collector.checkThat("If 'Run on selection change' checkbox is unchecked, 'paragraph.config.runOnSelectionChange' will be false ",
driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/span[contains(@ng-if, 'paragraph.config.runOnSelectionChange == false')]")).isDisplayed(),
CoreMatchers.equalTo(true));
Select sameDropDownMenu = new Select(driver.findElement(By.xpath((getParagraphXPath(1) + "//select"))));
Select sameDropDownMenu = new Select(driver.findElement(By.xpath((xpathToDropdownMenu))));
sameDropDownMenu.selectByVisibleText("1");
collector.checkThat("If 'RunOnSelectionChange' is false, the paragraph result won't be updated even if we select any options in the dropdown menu ",
driver.findElement(By.xpath(xpathToResultText)).getText(),
CoreMatchers.equalTo("My selection is 2"));
// run paragraph manually by pressing ENTER
driver.findElement(By.xpath(xpathToDropdownMenu)).sendKeys(Keys.ENTER);
collector.checkThat("Even if 'RunOnSelectionChange' is set as false, still can run the paragraph by pressing ENTER ",
driver.findElement(By.xpath(xpathToResultText)).getText(),
CoreMatchers.equalTo("My selection is 1"));
} catch (Exception e) {
handleException("Exception in ParagraphActionsIT while testRunOnSelectionChange ", e);