Add integration test for editOnDblClick

This commit is contained in:
Mina Lee 2016-10-22 00:29:24 +09:00
parent 0a26207d7a
commit b42039eb44
2 changed files with 46 additions and 2 deletions

View file

@ -429,5 +429,50 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
}
}
@Test
public void testEditOnDoubleClick() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
try {
createNewNote();
Actions action = new Actions(driver);
waitForParagraph(1, "READY");
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.SHIFT + "5");
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys("md" + Keys.ENTER);
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.SHIFT + "3");
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(" abc");
runParagraph(1);
waitForParagraph(1, "FINISHED");
collector.checkThat("Markdown editor is hidden after run ",
driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.editorHide')]")).isDisplayed(),
CoreMatchers.equalTo(false));
collector.checkThat("Markdown editor is shown after run ",
driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.tableHide')]")).isDisplayed(),
CoreMatchers.equalTo(true));
// to check if editOnDblClick field is fetched correctly after refresh
driver.navigate().refresh();
waitForParagraph(1, "FINISHED");
action.doubleClick(driver.findElement(By.xpath(getParagraphXPath(1)))).perform();
collector.checkThat("Markdown editor is shown after double click ",
driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.editorHide')]")).isDisplayed(),
CoreMatchers.equalTo(true));
collector.checkThat("Markdown editor is hidden after double click ",
driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.tableHide')]")).isDisplayed(),
CoreMatchers.equalTo(false));
deleteTestNotebook(driver);
} catch (Exception e) {
handleException("Exception in ParagraphActionsIT while testEditOnDoubleClick ", e);
}
}
}

View file

@ -67,8 +67,7 @@ limitations under the License.
class="executionTime" ng-bind-html="getExecutionTime()">
</div>
<div ng-if = "paragraph.status === 'RUNNING'" class = "paragraphFooterElapsed">
<div
id="{{paragraph.id}}_elapsedTime"
<div id="{{paragraph.id}}_elapsedTime"
class="elapsedTime" ng-bind-html="getElapsedTime()">
</div>
</div>