You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by fe...@apache.org on 2016/02/24 05:16:40 UTC
incubator-zeppelin git commit: test testAngularDisplay failure
Repository: incubator-zeppelin
Updated Branches:
refs/heads/master ff1a0c032 -> 2a5eca38c
test testAngularDisplay failure
### What is this PR for?
There are few times when Selenium test case "testAngularDisplay" fails. This to reproduce it on travis and fix it.
### What type of PR is it?
Bug Fix
Author: Prabhjyot Singh <pr...@gmail.com>
Closes #719 from prabhjyotsingh/testAngularDisplayFail and squashes the following commits:
2571505 [Prabhjyot Singh] replace System.out.println with LOG.info
2ea0d98 [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into testAngularDisplayFail
c358707 [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into testAngularDisplayFail
4351484 [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into testAngularDisplayFail
c3dba4b [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into testAngularDisplayFail
88c1ead [Prabhjyot Singh] correct x-path
c2591ae [Prabhjyot Singh] fail should go away
d3437ef [Prabhjyot Singh] trying to make CI fail again WebElement paragraph2Editor = driver.findElement(By.xpath(getParagraphXPath(10) + "//textarea"));
e2f6205 [Prabhjyot Singh] change import Base64
fd9c921 [Prabhjyot Singh] test testAngularDisplay failure
Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/2a5eca38
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/2a5eca38
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/2a5eca38
Branch: refs/heads/master
Commit: 2a5eca38ceb845edac9631996d2c559faa07728b
Parents: ff1a0c0
Author: Prabhjyot Singh <pr...@gmail.com>
Authored: Mon Feb 22 12:44:20 2016 +0530
Committer: Felix Cheung <fe...@apache.org>
Committed: Tue Feb 23 20:16:33 2016 -0800
----------------------------------------------------------------------
.../java/org/apache/zeppelin/AbstractZeppelinIT.java | 3 +++
.../zeppelin/integration/ParagraphActionsIT.java | 15 +++++----------
.../org/apache/zeppelin/integration/ZeppelinIT.java | 6 +++---
.../apache/zeppelin/AbstractFunctionalSuite.scala | 2 ++
4 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/2a5eca38/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java b/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
index 2b68356..7b3f3a7 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java
@@ -19,6 +19,8 @@ package org.apache.zeppelin;
import com.google.common.base.Function;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.FileUtils;
import org.openqa.selenium.*;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.FluentWait;
@@ -170,6 +172,7 @@ abstract public class AbstractZeppelinIT {
protected void handleException(String message, Exception e) throws Exception {
LOG.error(message, e);
File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
+ LOG.error("ScreenShot::\ndata:image/png;base64," + new String(Base64.encodeBase64(FileUtils.readFileToByteArray(scrFile))));
throw e;
}
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/2a5eca38/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 ee27db1..57835ea 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
@@ -59,7 +59,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
driver.quit();
}
@Test
- public void testCreateNewButton() throws InterruptedException {
+ public void testCreateNewButton() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
@@ -127,18 +127,15 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
ZeppelinITUtils.sleep(1000, false);
deleteTestNotebook(driver);
- } catch (ElementNotVisibleException e) {
- LOG.error("Exception in ParagraphActionsIT while testCreateNewButton ", e);
- File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
- throw e;
-
+ } catch (Exception e) {
+ handleException("Exception in ParagraphActionsIT while testCreateNewButton ", e);
}
}
@Test
- public void testRemoveButton() throws InterruptedException {
+ public void testRemoveButton() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
@@ -166,9 +163,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
deleteTestNotebook(driver);
} catch (Exception e) {
- LOG.error("Exception in ParagraphActionsIT while testRemoveButton ", e);
- File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
- throw e;
+ handleException("Exception in ParagraphActionsIT while testMoveUpAndDown ", e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/2a5eca38/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
index 026535b..caf2416 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/integration/ZeppelinIT.java
@@ -121,7 +121,7 @@ public class ZeppelinIT extends AbstractZeppelinIT {
// check expected text
waitForText("myVar=1", By.xpath(
- getParagraphXPath(3) + "//div[@ng-bind=\"paragraph.result.msg\"]"));
+ getParagraphXPath(3) + "//div[contains(@id,\"_text\") and @class=\"text\"]"));
/*
* Click element
@@ -162,7 +162,7 @@ public class ZeppelinIT extends AbstractZeppelinIT {
// check expected text by watcher
waitForText("myVar=3", By.xpath(
- getParagraphXPath(3) + "//div[@ng-bind=\"paragraph.result.msg\"]"));
+ getParagraphXPath(3) + "//div[contains(@id,\"_text\") and @class=\"text\"]"));
/*
* Unbind
@@ -196,7 +196,7 @@ public class ZeppelinIT extends AbstractZeppelinIT {
"//div[@class='modal-footer']//button[contains(.,'OK')]")).click();
sleep(100, true);
- System.out.println("testCreateNotebook Test executed");
+ LOG.info("testCreateNotebook Test executed");
} catch (Exception e) {
handleException("Exception in ZeppelinIT while testAngularDisplay ", e);
}
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/2a5eca38/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala b/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala
index 93899e4..694944d 100644
--- a/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala
+++ b/zeppelin-server/src/test/scala/org/apache/zeppelin/AbstractFunctionalSuite.scala
@@ -52,6 +52,8 @@ class AbstractFunctionalSuite extends FunSuite with WebBrowser with BeforeAndAft
override def afterAll() = {
"../bin/zeppelin-daemon.sh stop" !
+
+ webDriver.close()
}
def getDriver(): WebDriver = {