You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2016/02/08 09:20:50 UTC

incubator-zeppelin git commit: add new selenium test case for move paragraph up and down

Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master 77bde6415 -> 9b461ad24


add new selenium test  case for move paragraph up and down

### What is this PR for?
Add new  selenium test case for move paragraph up and down

### 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

### Screenshots (if appropriate)
N/A

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation?No

Author: Ravi Ranjan <ra...@gmail.com>

Closes #687 from ravicodder/testMoveUpAndDown and squashes the following commits:

0a2407c [Ravi Ranjan] add new test selenium case for move paragraph up and down


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

Branch: refs/heads/master
Commit: 9b461ad24683847a8ae0da187177dc3e7c752081
Parents: 77bde64
Author: Ravi Ranjan <ra...@gmail.com>
Authored: Wed Feb 3 11:01:56 2016 +0530
Committer: Lee moon soo <mo...@apache.org>
Committed: Mon Feb 8 17:23:43 2016 +0900

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


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/9b461ad2/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 41d7729..23aaf6f 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
@@ -20,6 +20,7 @@ package org.apache.zeppelin.integration;
 
 import org.apache.zeppelin.AbstractZeppelinIT;
 import org.apache.zeppelin.WebDriverManager;
+import org.apache.zeppelin.ZeppelinITUtils;
 import org.hamcrest.CoreMatchers;
 import org.junit.After;
 import org.junit.Before;
@@ -57,6 +58,66 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
   }
 
   @Test
+  public void testMoveUpAndDown() throws InterruptedException {
+    if (!endToEndTestEnabled()) {
+      return;
+    }
+    try {
+      createNewNote();
+
+      waitForParagraph(1, "READY");
+      WebElement paragraph1Editor = driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea"));
+      paragraph1Editor.sendKeys("1");
+
+      driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click();
+      driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='insertNew()']")).click();
+
+
+      waitForParagraph(2, "READY");
+      WebElement paragraph2Editor = driver.findElement(By.xpath(getParagraphXPath(2) + "//textarea"));
+      paragraph2Editor.sendKeys("2");
+
+
+      collector.checkThat("The paragraph1 value contains",
+              driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText(),
+              CoreMatchers.equalTo("1"));
+      collector.checkThat("The paragraph1 value contains",
+              driver.findElement(By.xpath(getParagraphXPath(2) + "//div[contains(@class, 'editor')]")).getText(),
+              CoreMatchers.equalTo("2"));
+
+      driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click();
+      driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='moveDown()']")).click();
+
+      ZeppelinITUtils.sleep(1000,false);
+
+      collector.checkThat("The paragraph1 value contains",
+              driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText(),
+              CoreMatchers.equalTo("2"));
+      collector.checkThat("The paragraph1 value contains",
+              driver.findElement(By.xpath(getParagraphXPath(2) + "//div[contains(@class, 'editor')]")).getText(),
+              CoreMatchers.equalTo("1"));
+
+      driver.findElement(By.xpath(getParagraphXPath(2) + "//span[@class='icon-settings']")).click();
+      driver.findElement(By.xpath(getParagraphXPath(2) + "//ul/li/a[@ng-click='moveUp()']")).click();
+
+      ZeppelinITUtils.sleep(1000,false);
+
+      collector.checkThat("The paragraph1 value contains",
+              driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText(),
+              CoreMatchers.equalTo("1"));
+      collector.checkThat("The paragraph1 value contains",
+              driver.findElement(By.xpath(getParagraphXPath(2) + "//div[contains(@class, 'editor')]")).getText(),
+              CoreMatchers.equalTo("2"));
+      ZeppelinITUtils.sleep(1000,false);
+      deleteTestNotebook(driver);
+
+    } catch (ElementNotVisibleException e) {
+      File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
+    }
+
+  }
+
+  @Test
   public void testDisableParagraphRunButton() throws InterruptedException {
     if (!endToEndTestEnabled()) {
       return;