Repository: zeppelin Updated Branches: refs/heads/master dec31d69e -> 8085ab678
[ZEPPELIN-1009] [HOTFIX] Fix Selenium test error ### What is this PR for? Fix selenium test error described in [ZEPPELIN-1009](https://issues.apache.org/jira/browse/ZEPPELIN-1009) ### What type of PR is it? Hot Fix ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-1009 ### How should this be tested? Outline the steps to test the PR here. ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: Lee moon soo <[email protected]> Closes #1034 from Leemoonsoo/ZEPPELIN-1009 and squashes the following commits: 9a048af [Lee moon soo] restore changes 13e15f1 [Lee moon soo] print browser log 63e8682 [Lee moon soo] sleep ec03834 [Lee moon soo] try trusty f05d741 [Lee moon soo] set firefox addon ver c33d9ff [Lee moon soo] try different xpath 430e273 [Lee moon soo] restore f145da5 [Lee moon soo] Take some screenshots b4cab5f [Lee moon soo] Remove debug mesg 1c1b2b8 [Lee moon soo] Increase resolution b2edf6f [Lee moon soo] change xvfb screen resolution 41d9875 [Lee moon soo] more msg 4d27bf7 [Lee moon soo] More mesg 1dd6e50 [Lee moon soo] add more debug msg 54d58b6 [Lee moon soo] escape quote fb3e9f6 [Lee moon soo] Add a paragraph infront to prevent main menu cover angular element 667578c [Lee moon soo] add debug messages da38256 [Lee moon soo] update getParagraphXPath() 55e78ec [Lee moon soo] trigger ci 13dee87 [Lee moon soo] fix Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/8085ab67 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/8085ab67 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/8085ab67 Branch: refs/heads/master Commit: 8085ab678e3404a7e8de594f85a1c2b3c11defb8 Parents: dec31d6 Author: Lee moon soo <[email protected]> Authored: Sun Jun 19 08:52:28 2016 -0700 Committer: Lee moon soo <[email protected]> Committed: Mon Jun 20 08:37:14 2016 -0700 ---------------------------------------------------------------------- .travis.yml | 3 +-- .../test/java/org/apache/zeppelin/AbstractZeppelinIT.java | 10 +++++++++- .../src/app/notebook/paragraph/paragraph.controller.js | 7 +++---- 3 files changed, 13 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/8085ab67/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 9ba565b..7fa8e15 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 1600x1024x16" install: - mvn $BUILD_FLAG $PROFILE -B http://git-wip-us.apache.org/repos/asf/zeppelin/blob/8085ab67/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 3e56747..e7dba46 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 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.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.Logger; 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; @@ -75,7 +79,7 @@ abstract public class AbstractZeppelinIT { 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) { @@ -151,6 +155,10 @@ abstract public class AbstractZeppelinIT { 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; http://git-wip-us.apache.org/repos/asf/zeppelin/blob/8085ab67/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index 2cf0222..6ab63cd 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() { @@ -443,7 +443,6 @@ angular.module('zeppelinWebApp') }, 500); } } - } }); @@ -523,7 +522,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, @@ -906,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); }
