From 13dee87619c11ab8770ad81ea2693a41840d4192 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Thu, 16 Jun 2016 23:06:57 -0700 Subject: [PATCH 01/20] fix --- .../src/app/notebook/paragraph/paragraph.controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index 21a17b221de..09dd40fdcfd 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -435,7 +435,7 @@ angular.module('zeppelinWebApp') if (statusChanged || resultRefreshed) { // when last paragraph runs, zeppelin automatically appends new paragraph. // this broadcast will focus to the newly inserted paragraph - var paragraphs = angular.element('div[id$="_paragraphColumn_main"'); + var paragraphs = angular.element('div[id$="_paragraphColumn_main"]'); if (paragraphs.length >= 2 && paragraphs[paragraphs.length-2].id.startsWith($scope.paragraph.id)) { // rendering output can took some time. So delay scrolling event firing for sometime. setTimeout(function() { @@ -523,7 +523,7 @@ angular.module('zeppelinWebApp') }; $scope.removeParagraph = function() { - var paragraphs = angular.element('div[id$="_paragraphColumn_main"'); + var paragraphs = angular.element('div[id$="_paragraphColumn_main"]'); if (paragraphs[paragraphs.length-1].id.startsWith($scope.paragraph.id)) { BootstrapDialog.alert({ closable: true, @@ -905,7 +905,7 @@ angular.module('zeppelinWebApp') $rootScope.$on('scrollToCursor', function(event) { // scroll on 'scrollToCursor' event only when cursor is in the last paragraph - var paragraphs = angular.element('div[id$="_paragraphColumn_main"'); + var paragraphs = angular.element('div[id$="_paragraphColumn_main"]'); if (paragraphs[paragraphs.length-1].id.startsWith($scope.paragraph.id)) { $scope.scrollToCursor($scope.paragraph.id, 0); } From 55e78ec7b1a7d07726df747f6e873201cc099865 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Fri, 17 Jun 2016 00:10:20 -0700 Subject: [PATCH 02/20] trigger ci --- zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js | 1 - 1 file changed, 1 deletion(-) diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index 09dd40fdcfd..591705abf54 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -443,7 +443,6 @@ angular.module('zeppelinWebApp') }, 500); } } - } }); From da382563ff7ca14eeccdd3147983d2150985ce0d Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Fri, 17 Jun 2016 00:55:10 -0700 Subject: [PATCH 03/20] update getParagraphXPath() --- .../src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a86d08b212a..9ad2c68e5e0 100644 --- a/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java @@ -75,7 +75,7 @@ protected void runParagraph(int paragraphNo) { protected String getParagraphXPath(int paragraphNo) { - return "//div[@ng-controller=\"ParagraphCtrl\"][" + paragraphNo + "]"; + return "(//div[@ng-controller=\"ParagraphCtrl\"])[" + paragraphNo + "]"; } protected boolean waitForParagraph(final int paragraphNo, final String state) { From 667578cc316ff7d7b42408db08b78829ddb38a4e Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 08:03:02 -0700 Subject: [PATCH 04/20] add debug messages --- .../test/java/org/apache/zeppelin/integration/ZeppelinIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b3bb99fbb36..fcc44283efd 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 @@ -137,14 +137,14 @@ public void testAngularDisplay() throws Exception { setTextOfParagraph(4, "z.angularWatch(\"myVar\", (before:Object, after:Object, context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ z.run(2, context)})"); runParagraph(4); waitForParagraph(4, "FINISHED"); - + try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; /* * Click element, again and see watcher works */ driver.findElement(By.xpath( getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")).click(); - + try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; // check expected text waitForText("BindingTest_3_", By.xpath( getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); From fb3e9f68cdb4f31cdc68ce3003c9550e65595c91 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 10:14:40 -0700 Subject: [PATCH 05/20] Add a paragraph infront to prevent main menu cover angular element --- .../zeppelin/integration/ZeppelinIT.java | 66 +++++++++++-------- 1 file changed, 37 insertions(+), 29 deletions(-) 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 fcc44283efd..7083305664a 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 @@ -80,53 +80,61 @@ public void testAngularDisplay() throws Exception { // wait for first paragraph's " READY " status text waitForParagraph(1, "READY"); + /** + * run a paragraph that takes some height of screen, so next paragraph is not hid by main + * menu bar. that prevent click event over angular element don't does to menu bar + */ + setTextOfParagraph(1, "println(\"%html
\")"); + runParagraph(1); + waitForParagraph(1, "FINISHED"); + /* * print angular template * %angular
BindingTest_{{myVar}}_
*/ - setTextOfParagraph(1, "println(\"%angular
BindingTest_{{myVar}}_
\")"); - runParagraph(1); - waitForParagraph(1, "FINISHED"); + setTextOfParagraph(2, "println(\"%angular
BindingTest_{{myVar}}_
\")"); + runParagraph(2); + waitForParagraph(2, "FINISHED"); // check expected text waitForText("BindingTest__", By.xpath( - getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); + getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); /* * Bind variable * z.angularBind("myVar", 1) */ - assertEquals(1, driver.findElements(By.xpath(getParagraphXPath(2) + "//textarea")).size()); - setTextOfParagraph(2, "z.angularBind(\"myVar\", 1)"); - runParagraph(2); - waitForParagraph(2, "FINISHED"); + assertEquals(1, driver.findElements(By.xpath(getParagraphXPath(3) + "//textarea")).size()); + setTextOfParagraph(3, "z.angularBind(\"myVar\", 1)"); + runParagraph(3); + waitForParagraph(3, "FINISHED"); // check expected text waitForText("BindingTest_1_", By.xpath( - getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); + getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); /* * print variable * print("myVar="+z.angular("myVar")) */ - setTextOfParagraph(3, "print(\"myVar=\"+z.angular(\"myVar\"))"); - runParagraph(3); - waitForParagraph(3, "FINISHED"); + setTextOfParagraph(4, "print(\"myVar=\"+z.angular(\"myVar\"))"); + runParagraph(4); + waitForParagraph(4, "FINISHED"); // check expected text waitForText("myVar=1", By.xpath( - getParagraphXPath(3) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); + getParagraphXPath(4) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); /* * Click element */ driver.findElement(By.xpath( - getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")).click(); + getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).click(); // check expected text waitForText("BindingTest_2_", By.xpath( - getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); + getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); /* * Register watcher @@ -134,47 +142,47 @@ public void testAngularDisplay() throws Exception { * z.run(2, context) * } */ - setTextOfParagraph(4, "z.angularWatch(\"myVar\", (before:Object, after:Object, context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ z.run(2, context)})"); - runParagraph(4); - waitForParagraph(4, "FINISHED"); + setTextOfParagraph(5, "z.angularWatch(\"myVar\", (before:Object, after:Object, context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ z.run(2, context)})"); + runParagraph(5); + waitForParagraph(5, "FINISHED"); try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; /* * Click element, again and see watcher works */ driver.findElement(By.xpath( - getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")).click(); + getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).click(); try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; // check expected text waitForText("BindingTest_3_", By.xpath( - getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); - waitForParagraph(3, "FINISHED"); + getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); + waitForParagraph(4, "FINISHED"); // check expected text by watcher waitForText("myVar=3", By.xpath( - getParagraphXPath(3) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); + getParagraphXPath(4) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); /* * Unbind * z.angularUnbind("myVar") */ - setTextOfParagraph(5, "z.angularUnbind(\"myVar\")"); - runParagraph(5); - waitForParagraph(5, "FINISHED"); + setTextOfParagraph(6, "z.angularUnbind(\"myVar\")"); + runParagraph(6); + waitForParagraph(6, "FINISHED"); // check expected text waitForText("BindingTest__", - By.xpath(getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); + By.xpath(getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); /* * Bind again and see rebind works. */ - runParagraph(2); - waitForParagraph(2, "FINISHED"); + runParagraph(3); + waitForParagraph(3, "FINISHED"); // check expected text waitForText("BindingTest_1_", - By.xpath(getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); + By.xpath(getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); driver.findElement(By.xpath("//*[@id='main']/div//h3/span/button[@tooltip='Remove the notebook']")) .sendKeys(Keys.ENTER); From 54d58b6c905f061832c975e807f2fab613eb8d1a Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 10:36:50 -0700 Subject: [PATCH 06/20] escape quote --- .../test/java/org/apache/zeppelin/integration/ZeppelinIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7083305664a..ab9112cf6dd 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 @@ -84,7 +84,7 @@ public void testAngularDisplay() throws Exception { * run a paragraph that takes some height of screen, so next paragraph is not hid by main * menu bar. that prevent click event over angular element don't does to menu bar */ - setTextOfParagraph(1, "println(\"%html
\")"); + setTextOfParagraph(1, "println(\"%html
\")"); runParagraph(1); waitForParagraph(1, "FINISHED"); From 1dd6e50d0bfbbe42af7372b3bedc098022824ff6 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 11:02:46 -0700 Subject: [PATCH 07/20] add more debug msg --- .../test/java/org/apache/zeppelin/integration/ZeppelinIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ab9112cf6dd..01628b05021 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 @@ -87,7 +87,7 @@ public void testAngularDisplay() throws Exception { setTextOfParagraph(1, "println(\"%html
\")"); runParagraph(1); waitForParagraph(1, "FINISHED"); - + try { handleException("Debug 11", new RuntimeException());} catch (Exception e) {}; /* * print angular template * %angular
BindingTest_{{myVar}}_
@@ -95,7 +95,7 @@ public void testAngularDisplay() throws Exception { setTextOfParagraph(2, "println(\"%angular
BindingTest_{{myVar}}_
\")"); runParagraph(2); waitForParagraph(2, "FINISHED"); - + try { handleException("Debug 12", new RuntimeException());} catch (Exception e) {}; // check expected text waitForText("BindingTest__", By.xpath( getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); From 4d27bf7c3bbb84f1ed21cb77326d8421964569d3 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 11:04:36 -0700 Subject: [PATCH 08/20] More mesg --- .../test/java/org/apache/zeppelin/integration/ZeppelinIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 01628b05021..ebbcb0bf55b 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 @@ -146,7 +146,8 @@ public void testAngularDisplay() throws Exception { runParagraph(5); waitForParagraph(5, "FINISHED"); try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; - + System.err.println("angularButtonName = " + driver.findElement(By.xpath( + getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).getText()); /* * Click element, again and see watcher works */ From 41d9875e6cbff40b68c25b8d12fecaed110f24e3 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 20:28:20 -0700 Subject: [PATCH 09/20] more msg --- .../org/apache/zeppelin/integration/ZeppelinIT.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 ebbcb0bf55b..23ddcb0204b 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 @@ -87,7 +87,7 @@ public void testAngularDisplay() throws Exception { setTextOfParagraph(1, "println(\"%html
\")"); runParagraph(1); waitForParagraph(1, "FINISHED"); - try { handleException("Debug 11", new RuntimeException());} catch (Exception e) {}; + try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; /* * print angular template * %angular
BindingTest_{{myVar}}_
@@ -95,7 +95,7 @@ public void testAngularDisplay() throws Exception { setTextOfParagraph(2, "println(\"%angular
BindingTest_{{myVar}}_
\")"); runParagraph(2); waitForParagraph(2, "FINISHED"); - try { handleException("Debug 12", new RuntimeException());} catch (Exception e) {}; + try { handleException("Debug 2", new RuntimeException());} catch (Exception e) {}; // check expected text waitForText("BindingTest__", By.xpath( getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); @@ -112,7 +112,7 @@ public void testAngularDisplay() throws Exception { // check expected text waitForText("BindingTest_1_", By.xpath( getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); - + try { handleException("Debug 3", new RuntimeException());} catch (Exception e) {}; /* * print variable @@ -125,7 +125,7 @@ public void testAngularDisplay() throws Exception { // check expected text waitForText("myVar=1", By.xpath( getParagraphXPath(4) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); - + try { handleException("Debug 4", new RuntimeException());} catch (Exception e) {}; /* * Click element */ @@ -145,7 +145,7 @@ public void testAngularDisplay() throws Exception { setTextOfParagraph(5, "z.angularWatch(\"myVar\", (before:Object, after:Object, context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ z.run(2, context)})"); runParagraph(5); waitForParagraph(5, "FINISHED"); - try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; + try { handleException("Debug 5", new RuntimeException());} catch (Exception e) {}; System.err.println("angularButtonName = " + driver.findElement(By.xpath( getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).getText()); /* @@ -153,7 +153,7 @@ public void testAngularDisplay() throws Exception { */ driver.findElement(By.xpath( getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).click(); - try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; + try { handleException("Debug 6", new RuntimeException());} catch (Exception e) {}; // check expected text waitForText("BindingTest_3_", By.xpath( getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); From b2edf6f626124832eb3dd40827f1256896253a0a Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 21:02:51 -0700 Subject: [PATCH 10/20] change xvfb screen resolution --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ba565b8586..d64eb772a9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,8 +67,7 @@ before_install: - echo 'R_LIBS=~/R' > ~/.Renviron - R -e "install.packages('knitr', repos = 'http://cran.us.r-project.org', lib='~/R')" - export R_LIBS='~/R' - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" + - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16" install: - mvn $BUILD_FLAG $PROFILE -B From 1c1b2b83635e1112579b3ef7e2a3e7782da11546 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 21:34:13 -0700 Subject: [PATCH 11/20] Increase resolution --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d64eb772a9e..7fa8e156ab0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,7 +67,7 @@ before_install: - echo 'R_LIBS=~/R' > ~/.Renviron - R -e "install.packages('knitr', repos = 'http://cran.us.r-project.org', lib='~/R')" - export R_LIBS='~/R' - - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16" + - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1600x1024x16" install: - mvn $BUILD_FLAG $PROFILE -B From b4cab5fc5926f45e55f8c137b092fd5273db07f8 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 22:47:00 -0700 Subject: [PATCH 12/20] Remove debug mesg --- .../zeppelin/integration/ZeppelinIT.java | 75 ++++++++----------- 1 file changed, 32 insertions(+), 43 deletions(-) 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 23ddcb0204b..b6ef3d62746 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 @@ -80,61 +80,52 @@ public void testAngularDisplay() throws Exception { // wait for first paragraph's " READY " status text waitForParagraph(1, "READY"); - /** - * run a paragraph that takes some height of screen, so next paragraph is not hid by main - * menu bar. that prevent click event over angular element don't does to menu bar - */ - setTextOfParagraph(1, "println(\"%html
\")"); - runParagraph(1); - waitForParagraph(1, "FINISHED"); - try { handleException("Debug 1", new RuntimeException());} catch (Exception e) {}; /* * print angular template * %angular
BindingTest_{{myVar}}_
*/ - setTextOfParagraph(2, "println(\"%angular
BindingTest_{{myVar}}_
\")"); - runParagraph(2); - waitForParagraph(2, "FINISHED"); - try { handleException("Debug 2", new RuntimeException());} catch (Exception e) {}; + setTextOfParagraph(1, "println(\"%angular
BindingTest_{{myVar}}_
\")"); + runParagraph(1); + waitForParagraph(1, "FINISHED"); + // check expected text waitForText("BindingTest__", By.xpath( - getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); + getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); /* * Bind variable * z.angularBind("myVar", 1) */ assertEquals(1, driver.findElements(By.xpath(getParagraphXPath(3) + "//textarea")).size()); - setTextOfParagraph(3, "z.angularBind(\"myVar\", 1)"); - runParagraph(3); - waitForParagraph(3, "FINISHED"); + setTextOfParagraph(2, "z.angularBind(\"myVar\", 1)"); + runParagraph(2); + waitForParagraph(2, "FINISHED"); // check expected text waitForText("BindingTest_1_", By.xpath( - getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); - try { handleException("Debug 3", new RuntimeException());} catch (Exception e) {}; + getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); /* * print variable * print("myVar="+z.angular("myVar")) */ - setTextOfParagraph(4, "print(\"myVar=\"+z.angular(\"myVar\"))"); - runParagraph(4); - waitForParagraph(4, "FINISHED"); + setTextOfParagraph(3, "print(\"myVar=\"+z.angular(\"myVar\"))"); + runParagraph(3); + waitForParagraph(3, "FINISHED"); // check expected text waitForText("myVar=1", By.xpath( - getParagraphXPath(4) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); - try { handleException("Debug 4", new RuntimeException());} catch (Exception e) {}; + getParagraphXPath(3) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); + /* * Click element */ driver.findElement(By.xpath( - getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).click(); + getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")).click(); // check expected text waitForText("BindingTest_2_", By.xpath( - getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); + getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); /* * Register watcher @@ -142,48 +133,46 @@ public void testAngularDisplay() throws Exception { * z.run(2, context) * } */ - setTextOfParagraph(5, "z.angularWatch(\"myVar\", (before:Object, after:Object, context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ z.run(2, context)})"); - runParagraph(5); - waitForParagraph(5, "FINISHED"); - try { handleException("Debug 5", new RuntimeException());} catch (Exception e) {}; - System.err.println("angularButtonName = " + driver.findElement(By.xpath( - getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).getText()); + setTextOfParagraph(4, "z.angularWatch(\"myVar\", (before:Object, after:Object, context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ z.run(2, context)})"); + runParagraph(4); + waitForParagraph(4, "FINISHED"); + /* * Click element, again and see watcher works */ driver.findElement(By.xpath( - getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")).click(); - try { handleException("Debug 6", new RuntimeException());} catch (Exception e) {}; + getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")).click(); + // check expected text waitForText("BindingTest_3_", By.xpath( - getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); - waitForParagraph(4, "FINISHED"); + getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); + waitForParagraph(3, "FINISHED"); // check expected text by watcher waitForText("myVar=3", By.xpath( - getParagraphXPath(4) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); + getParagraphXPath(3) + "//div[contains(@id,\"_text\") and @class=\"text\"]")); /* * Unbind * z.angularUnbind("myVar") */ - setTextOfParagraph(6, "z.angularUnbind(\"myVar\")"); - runParagraph(6); - waitForParagraph(6, "FINISHED"); + setTextOfParagraph(5, "z.angularUnbind(\"myVar\")"); + runParagraph(5); + waitForParagraph(5, "FINISHED"); // check expected text waitForText("BindingTest__", - By.xpath(getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); + By.xpath(getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); /* * Bind again and see rebind works. */ - runParagraph(3); - waitForParagraph(3, "FINISHED"); + runParagraph(2); + waitForParagraph(2, "FINISHED"); // check expected text waitForText("BindingTest_1_", - By.xpath(getParagraphXPath(2) + "//div[@id=\"angularTestButton\"]")); + By.xpath(getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); driver.findElement(By.xpath("//*[@id='main']/div//h3/span/button[@tooltip='Remove the notebook']")) .sendKeys(Keys.ENTER); From f145da5497d05cf100e0b96605e792deef03cc25 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 23:03:12 -0700 Subject: [PATCH 13/20] Take some screenshots --- .../org/apache/zeppelin/integration/ParagraphActionsIT.java | 4 ++++ 1 file changed, 4 insertions(+) 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 d1135c052fb..8f798381932 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 @@ -72,9 +72,13 @@ public void testCreateNewButton() throws Exception { collector.checkThat("Before Insert New : the number of paragraph ", oldNosOfParas, CoreMatchers.equalTo(1)); + try { handleException("Debug 1", new RuntimeException()); } catch (Exception e) {}; driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click(); + try { handleException("Debug 2", new RuntimeException()); } catch (Exception e) {}; driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='insertNew()']")).click(); + try { handleException("Debug 3", new RuntimeException()); } catch (Exception e) {}; waitForParagraph(2, "READY"); + try { handleException("Debug 4", new RuntimeException()); } catch (Exception e) {}; Integer newNosOfParas = driver.findElements(By.xpath("//div[@ng-controller=\"ParagraphCtrl\"]")).size(); collector.checkThat("After Insert New (using Insert New button) : number of paragraph", oldNosOfParas + 1, From 430e2738536011394be3d5a163d91583dd2b05e9 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sat, 18 Jun 2016 23:10:26 -0700 Subject: [PATCH 14/20] restore --- .../test/java/org/apache/zeppelin/integration/ZeppelinIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b6ef3d62746..32c4811147b 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 @@ -96,7 +96,7 @@ public void testAngularDisplay() throws Exception { * Bind variable * z.angularBind("myVar", 1) */ - assertEquals(1, driver.findElements(By.xpath(getParagraphXPath(3) + "//textarea")).size()); + assertEquals(1, driver.findElements(By.xpath(getParagraphXPath(2) + "//textarea")).size()); setTextOfParagraph(2, "z.angularBind(\"myVar\", 1)"); runParagraph(2); waitForParagraph(2, "FINISHED"); From c33d9ffe0cd49fa1dfe343b3aa954b2f8d84ba8b Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sun, 19 Jun 2016 00:06:49 -0700 Subject: [PATCH 15/20] try different xpath --- .../org/apache/zeppelin/integration/ParagraphActionsIT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 8f798381932..017f8dffc16 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 @@ -75,7 +75,7 @@ public void testCreateNewButton() throws Exception { try { handleException("Debug 1", new RuntimeException()); } catch (Exception e) {}; driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click(); try { handleException("Debug 2", new RuntimeException()); } catch (Exception e) {}; - driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='insertNew()']")).click(); + driver.findElement(By.xpath(getParagraphXPath(1) + "//a[@ng-click='insertNew()']")).click(); try { handleException("Debug 3", new RuntimeException()); } catch (Exception e) {}; waitForParagraph(2, "READY"); try { handleException("Debug 4", new RuntimeException()); } catch (Exception e) {}; @@ -85,7 +85,7 @@ public void testCreateNewButton() throws Exception { CoreMatchers.equalTo(newNosOfParas)); driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click(); - driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='removeParagraph()']")).click(); + driver.findElement(By.xpath(getParagraphXPath(1) + "//a[@ng-click='removeParagraph()']")).click(); ZeppelinITUtils.sleep(1000, false); driver.findElement(By.xpath("//div[@class='modal-dialog'][contains(.,'delete this paragraph')]" + "//div[@class='modal-footer']//button[contains(.,'OK')]")).click(); From f05d741e4e7144ee4312857f2dcc41af0f398853 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sun, 19 Jun 2016 00:40:24 -0700 Subject: [PATCH 16/20] set firefox addon ver --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7fa8e156ab0..bda5a3dafad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ addons: - r-base-dev - r-cran-evaluate - r-cran-base64enc + firefox: "31.0" matrix: include: From ec03834d6602165b6ef06daed4c15bf6ca047e0b Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sun, 19 Jun 2016 00:42:13 -0700 Subject: [PATCH 17/20] try trusty --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index bda5a3dafad..f0869c6c2b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ language: java sudo: false +dist: trusty cache: directories: From 63e8682185e8ea2e8a84741c807ab39e664ab278 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sun, 19 Jun 2016 01:14:38 -0700 Subject: [PATCH 18/20] sleep --- .../org/apache/zeppelin/integration/ParagraphActionsIT.java | 2 ++ 1 file changed, 2 insertions(+) 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 017f8dffc16..958b5d1fcbf 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 @@ -75,7 +75,9 @@ public void testCreateNewButton() throws Exception { try { handleException("Debug 1", new RuntimeException()); } catch (Exception e) {}; driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click(); try { handleException("Debug 2", new RuntimeException()); } catch (Exception e) {}; + Thread.sleep(1000); driver.findElement(By.xpath(getParagraphXPath(1) + "//a[@ng-click='insertNew()']")).click(); + Thread.sleep(1000); try { handleException("Debug 3", new RuntimeException()); } catch (Exception e) {}; waitForParagraph(2, "READY"); try { handleException("Debug 4", new RuntimeException()); } catch (Exception e) {}; From 13e15f1229ba5d5bdd644a94d59b90f6bfff2c32 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sun, 19 Jun 2016 02:13:32 -0700 Subject: [PATCH 19/20] print browser log --- .../test/java/org/apache/zeppelin/AbstractZeppelinIT.java | 8 ++++++++ .../apache/zeppelin/integration/ParagraphActionsIT.java | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) 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 9ad2c68e5e0..7502c57eb17 100644 --- a/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/AbstractZeppelinIT.java @@ -22,6 +22,9 @@ import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.FileUtils; import org.openqa.selenium.*; +import org.openqa.selenium.logging.LogEntries; +import org.openqa.selenium.logging.LogEntry; +import org.openqa.selenium.logging.LogType; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.FluentWait; import org.openqa.selenium.support.ui.Wait; @@ -30,6 +33,7 @@ import org.slf4j.LoggerFactory; import java.io.File; +import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -151,6 +155,10 @@ protected void deleteTestNotebook(final WebDriver driver) { protected void handleException(String message, Exception e) throws Exception { LOG.error(message, e); + LogEntries logEntries = driver.manage().logs().get(LogType.BROWSER); + for (LogEntry entry : logEntries) { + LOG.error(new Date(entry.getTimestamp()) + " " + entry.getLevel() + " " + entry.getMessage()); + } File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); LOG.error("ScreenShot::\ndata:image/png;base64," + new String(Base64.encodeBase64(FileUtils.readFileToByteArray(scrFile)))); throw e; 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 958b5d1fcbf..017f8dffc16 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 @@ -75,9 +75,7 @@ public void testCreateNewButton() throws Exception { try { handleException("Debug 1", new RuntimeException()); } catch (Exception e) {}; driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click(); try { handleException("Debug 2", new RuntimeException()); } catch (Exception e) {}; - Thread.sleep(1000); driver.findElement(By.xpath(getParagraphXPath(1) + "//a[@ng-click='insertNew()']")).click(); - Thread.sleep(1000); try { handleException("Debug 3", new RuntimeException()); } catch (Exception e) {}; waitForParagraph(2, "READY"); try { handleException("Debug 4", new RuntimeException()); } catch (Exception e) {}; From 9a048af35848347db1b96fd490720156e2e9c4f3 Mon Sep 17 00:00:00 2001 From: Lee moon soo Date: Sun, 19 Jun 2016 08:52:28 -0700 Subject: [PATCH 20/20] restore changes --- .travis.yml | 2 -- .../apache/zeppelin/integration/ParagraphActionsIT.java | 8 ++------ .../java/org/apache/zeppelin/integration/ZeppelinIT.java | 2 ++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0869c6c2b1..7fa8e156ab0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ language: java sudo: false -dist: trusty cache: directories: @@ -31,7 +30,6 @@ addons: - r-base-dev - r-cran-evaluate - r-cran-base64enc - firefox: "31.0" matrix: include: 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 017f8dffc16..d1135c052fb 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 @@ -72,20 +72,16 @@ public void testCreateNewButton() throws Exception { collector.checkThat("Before Insert New : the number of paragraph ", oldNosOfParas, CoreMatchers.equalTo(1)); - try { handleException("Debug 1", new RuntimeException()); } catch (Exception e) {}; driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click(); - try { handleException("Debug 2", new RuntimeException()); } catch (Exception e) {}; - driver.findElement(By.xpath(getParagraphXPath(1) + "//a[@ng-click='insertNew()']")).click(); - try { handleException("Debug 3", new RuntimeException()); } catch (Exception e) {}; + driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='insertNew()']")).click(); waitForParagraph(2, "READY"); - try { handleException("Debug 4", new RuntimeException()); } catch (Exception e) {}; Integer newNosOfParas = driver.findElements(By.xpath("//div[@ng-controller=\"ParagraphCtrl\"]")).size(); collector.checkThat("After Insert New (using Insert New button) : number of paragraph", oldNosOfParas + 1, CoreMatchers.equalTo(newNosOfParas)); driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click(); - driver.findElement(By.xpath(getParagraphXPath(1) + "//a[@ng-click='removeParagraph()']")).click(); + driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='removeParagraph()']")).click(); ZeppelinITUtils.sleep(1000, false); driver.findElement(By.xpath("//div[@class='modal-dialog'][contains(.,'delete this paragraph')]" + "//div[@class='modal-footer']//button[contains(.,'OK')]")).click(); 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 32c4811147b..b3bb99fbb36 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 @@ -105,6 +105,7 @@ public void testAngularDisplay() throws Exception { waitForText("BindingTest_1_", By.xpath( getParagraphXPath(1) + "//div[@id=\"angularTestButton\"]")); + /* * print variable * print("myVar="+z.angular("myVar")) @@ -137,6 +138,7 @@ public void testAngularDisplay() throws Exception { runParagraph(4); waitForParagraph(4, "FINISHED"); + /* * Click element, again and see watcher works */