Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master e5f4aeade -> 1b29275e0


Add selenium test case to test hide and show line number button of paragraph

What is this PR for?

Add a new test case for testing the show line number and hide line number 
button.
These buttons are used to show line number in paragraph

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 #690 from ravicodder/testHideAndShowLineNumber and squashes the 
following commits:

e02c939 [Ravi Ranjan] Merge branch 'master' of 
https://github.com/apache/incubator-zeppelin into testHideAndShowLineNumber
9f033d1 [Ravi Ranjan] Merge https://github.com/ravicodder/incubator-zeppelin 
into testHideAndShowLineNumber
41b1999 [Ravi Ranjan] Merge branch 'master' of 
https://github.com/apache/incubator-zeppelin into testHideAndShowLineNumber
3c176ce [Ravi Ranjan] Merge branch 'master' of 
https://github.com/apache/incubator-zeppelin into testHideAndShowLineNumber
c38c635 [Ravi Ranjan] Used reusable variable to store xpath
fd9979d [Ravi Ranjan] Correcting bad rebase
4aeb3df [Ravi Ranjan] Use handleException
7323a76 [Ravi Ranjan] Merge remote-tracking branch 'origin/master' into 
testHideAndShowLineNumber
2299edb [Ravi Ranjan] Indented the code properly
de835cd [Ravi Ranjan] Merge branch 'master' of 
https://github.com/apache/incubator-zeppelin into testHideAndShowLineNumber
4265616 [Ravi Ranjan] Modify ElementNotVisible Exception to Exception
b32d163 [Ravi Ranjan]  Modify InterruptedException to Exception
1031e49 [Ravi Ranjan] Merge branch 'master' of 
https://github.com/ravicodder/incubator-zeppelin into testHideAndShowLineNumber
60a945c [Ravi Ranjan] Remove testTitle test case
53d5d82 [Ravi Ranjan] Modified Error message
128db1f [Ravi Ranjan] Merge branch 'master' into testHideAndShowLineNumber
63edda8 [Ravi Ranjan] Add LOG.error message in catch statement
575f5ef [Ravi Ranjan] Modify the Debug messages and checkthat statement is 
improved to make sense
e11ff73 [Ravi Ranjan] Add new selenium test case to test show line number and 
Hide line number button
f326fd2 [Ravi Ranjan] Add new selenium test case to test hide and show line 
number button


Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/1b29275e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/1b29275e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/1b29275e

Branch: refs/heads/master
Commit: 1b29275e016ae1791c0c7676e3e09019f44dfc17
Parents: e5f4aea
Author: Ravi Ranjan <[email protected]>
Authored: Wed Mar 9 10:39:22 2016 +0530
Committer: Damien CORNEAU <[email protected]>
Committed: Thu Mar 10 10:57:39 2016 +0900

----------------------------------------------------------------------
 .../integration/ParagraphActionsIT.java         | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/1b29275e/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 9aaa2e8..544004c 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
@@ -386,4 +386,45 @@ public class ParagraphActionsIT extends AbstractZeppelinIT 
{
 
   }
 
+  @Test
+  public void testShowAndHideLineNumbers() throws Exception {
+    if (!endToEndTestEnabled()) {
+      return;
+    }
+    try {
+      createNewNote();
+
+      waitForParagraph(1, "READY");
+      String xpathToLineNumberField=getParagraphXPath(1) + 
"//div[contains(@class, 'ace_gutter-layer')]";
+      String xpathToShowLineNumberButton=getParagraphXPath(1) + 
"//ul/li/a[@ng-click='showLineNumbers()']";
+      String xpathToHideLineNumberButton=getParagraphXPath(1) + 
"//ul/li/a[@ng-click='hideLineNumbers()']";
+
+      collector.checkThat("Before \"Show line number\" the Line Number is 
Enabled ",
+          driver.findElement(By.xpath(xpathToLineNumberField)).isDisplayed(),
+          CoreMatchers.equalTo(false));
+      driver.findElement(By.xpath(getParagraphXPath(1) + 
"//span[@class='icon-settings']")).click();
+      collector.checkThat("Before \"Show line number\" The option panel in 
paragraph has button labeled ",
+          driver.findElement(By.xpath(xpathToShowLineNumberButton)).getText(),
+          CoreMatchers.equalTo("Show line numbers"));
+      driver.findElement(By.xpath(xpathToShowLineNumberButton)).click();
+      collector.checkThat("After \"Show line number\" the Line Number is 
Enabled ",
+          driver.findElement(By.xpath(xpathToLineNumberField)).isDisplayed(),
+          CoreMatchers.equalTo(true));
+      driver.findElement(By.xpath(getParagraphXPath(1) + 
"//span[@class='icon-settings']")).click();
+      collector.checkThat("After \"Show line number\" The option panel in 
paragraph has button labeled ",
+          driver.findElement(By.xpath(xpathToHideLineNumberButton)).getText(),
+          CoreMatchers.equalTo("Hide line numbers"));
+      driver.findElement(By.xpath(xpathToHideLineNumberButton)).click();
+      collector.checkThat("After \"Hide line number\" the Line Number is 
Enabled",
+          driver.findElement(By.xpath(xpathToLineNumberField)).isDisplayed(),
+          CoreMatchers.equalTo(false));
+      ZeppelinITUtils.sleep(1000, false);
+      deleteTestNotebook(driver);
+
+    } catch (Exception e) {
+      handleException("Exception in ParagraphActionsIT while 
testShowAndHideLineNumbers ", e);
+    }
+  }
+
+
 }
\ No newline at end of file

Reply via email to