Repository: incubator-zeppelin Updated Branches: refs/heads/master ee5590ac3 -> 64acfa9c8
Add selenium test case for show and hide title of paragraph What is this PR for? Add a new test case for testing the show title and hide title button. What type of PR is it? Test Is there a relevant Jira issue? NA How should this be tested? On OSX, you'll need firefox 42.0 installed, then you can run with PATH=~/Applications/Firefox.app/Contents/MacOS/:$PATH CI="" \ mvn -Dtest=org.apache.zeppelin.ParagraphActionsIT -Denforcer.skip=true \ test -pl zeppelin-server Questions: Does the licenses files need update?NO Is there breaking changes for older versions?NO Does this needs documentation?NO Author: Ravi Ranjan <[email protected]> Closes #692 from ravicodder/testTitleButton and squashes the following commits: e8a70df [Ravi Ranjan] Merge branch 'master' of https://github.com/apache/incubator-zeppelin into testTitleButton d4273d8 [Ravi Ranjan] Merge branch 'master' of https://github.com/apache/incubator-zeppelin into testTitleButton fc25477 [Ravi Ranjan] corrected Typo and modified xpath of show tilte and hide title button 4e973b3 [Ravi Ranjan] Used more specific path for Title field 6f3a76c [Ravi Ranjan] Merge remote-tracking branch 'origin/master' into testTitleButton 6bf1299 [Ravi Ranjan] Use handleException 699a334 [Ravi Ranjan] Merge branch 'master' of https://github.com/apache/incubator-zeppelin into testTitleButton bb41455 [Ravi Ranjan] Add wait after refresh , modify InterruptedException to Exception 6ebf755 [Ravi Ranjan] Modified Exception from ElementNotVisilbleException 4ae11e5 [Ravi Ranjan] Merge origin/master testTitleButton 70db47d [Ravi Ranjan] Merge remote-tracking branch 'origin/master' into testTitleButton 3426ba5 [Ravi Ranjan] Modify the Debug messages 14c8448 [Ravi Ranjan] Add selenium test case for show and hide title of paragraph Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/64acfa9c Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/64acfa9c Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/64acfa9c Branch: refs/heads/master Commit: 64acfa9c8e9c797d82a063490b2ba548362417d6 Parents: ee5590a Author: Ravi Ranjan <[email protected]> Authored: Fri Mar 4 10:35:25 2016 +0530 Committer: Damien CORNEAU <[email protected]> Committed: Wed Mar 9 11:12:13 2016 +0900 ---------------------------------------------------------------------- .../integration/ParagraphActionsIT.java | 61 +++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/64acfa9c/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java index 049579a..9aaa2e8 100644 --- a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ParagraphActionsIT.java @@ -322,7 +322,66 @@ public class ParagraphActionsIT extends AbstractZeppelinIT { CoreMatchers.equalTo(true)); } } catch (Exception e) { - handleException("Exception in ParagraphActionsIT while testWidth ", e); + handleException("Exception in ParagraphActionsIT while testWidth ", e); + } + + } + + @Test + public void testTitleButton() throws Exception { + if (!endToEndTestEnabled()) { + return; + } + try { + createNewNote(); + + waitForParagraph(1, "READY"); + + String xpathToTitle = getParagraphXPath(1) + "//div[contains(@class, 'title')]/div"; + String xpathToSettingIcon = getParagraphXPath(1) + "//span[@class='icon-settings']"; + String xpathToShowTitle=getParagraphXPath(1) + "//ul/li/a[@ng-click='showTitle()']"; + String xpathToHideTitle=getParagraphXPath(1) + "//ul/li/a[@ng-click='hideTitle()']"; + + collector.checkThat("Before Show Title : The title field contains", + driver.findElement(By.xpath(xpathToTitle)).getText(), + CoreMatchers.equalTo("")); + driver.findElement(By.xpath(xpathToSettingIcon)).click(); + collector.checkThat("Before Show Title : The title option in option panel of paragraph is labeled as ", + driver.findElement(By.xpath(xpathToShowTitle)).getText(), + CoreMatchers.equalTo("Show title")); + + driver.findElement(By.xpath(xpathToShowTitle)).click(); + collector.checkThat("After Show Title : The title field contains", + driver.findElement(By.xpath(xpathToTitle)).getText(), + CoreMatchers.equalTo("Untitled")); + + driver.findElement(By.xpath(xpathToSettingIcon)).click(); + collector.checkThat("After Show Title : The title option in option panel of paragraph is labeled as", + driver.findElement(By.xpath(xpathToHideTitle)).getText(), + CoreMatchers.equalTo("Hide title")); + + driver.findElement(By.xpath(xpathToHideTitle)).click(); + collector.checkThat("After Hide Title : The title field contains", + driver.findElement(By.xpath(xpathToTitle)).getText(), + CoreMatchers.equalTo("")); + driver.findElement(By.xpath(xpathToSettingIcon)).click(); + driver.findElement(By.xpath(xpathToShowTitle)).click(); + + driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'title')]")).click(); + driver.findElement(By.xpath(getParagraphXPath(1) + "//input")).sendKeys("NEW TITLE" + Keys.ENTER); + collector.checkThat("After Editing the Title : The title field contains ", + driver.findElement(By.xpath(xpathToTitle)).getText(), + CoreMatchers.equalTo("NEW TITLE")); + driver.navigate().refresh(); + ZeppelinITUtils.sleep(1000, false); + collector.checkThat("After Page Refresh : The title field contains ", + driver.findElement(By.xpath(xpathToTitle)).getText(), + CoreMatchers.equalTo("NEW TITLE")); + ZeppelinITUtils.sleep(1000, false); + deleteTestNotebook(driver); + + } catch (Exception e) { + handleException("Exception in ParagraphActionsIT while testTitleButton ", e); } }
