You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by bz...@apache.org on 2016/06/27 15:26:48 UTC

zeppelin git commit: [ZEPPELIN-1064] Flaky Test - ParagraphActionsIT.testTitleButton

Repository: zeppelin
Updated Branches:
  refs/heads/master c456967d4 -> 4b63867aa


[ZEPPELIN-1064] Flaky Test - ParagraphActionsIT.testTitleButton

### What is this PR for?
This is fix for test failing in CI

```
testTitleButton(org.apache.zeppelin.integration.ParagraphActionsIT)  Time elapsed: 11.11 sec  <<< FAILURE!
java.lang.AssertionError: After Show Title : The title field contains
Expected: "Untitled"
     but: was ""
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:865)
	at org.junit.rules.ErrorCollector$1.call(ErrorCollector.java:65)
	at org.junit.rules.ErrorCollector.checkSucceeds(ErrorCollector.java:78)
	at org.junit.rules.ErrorCollector.checkThat(ErrorCollector.java:63)
	at org.apache.zeppelin.integration.ParagraphActionsIT.testTitleButton(ParagraphActionsIT.java:350)
```

### What type of PR is it?
[Bug Fix | Test]

### Todos
* [x] - add delay before checking the values

### What is the Jira issue?
* [ZEPPELIN-1064](https://issues.apache.org/jira/browse/ZEPPELIN-1064)

### How should this be tested?
CI should be green

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

Author: Prabhjyot Singh <pr...@gmail.com>

Closes #1092 from prabhjyotsingh/ZEPPELIN-1064 and squashes the following commits:

5eac352 [Prabhjyot Singh] use "clickAndWait" before all collector.checkThat/reading elements
f6b53e5 [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into ZEPPELIN-1064
bd5a641 [Prabhjyot Singh] revert org.apache.zeppelin.ZeppelinITUtils
830f34b [Prabhjyot Singh] add delay before checking the values


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

Branch: refs/heads/master
Commit: 4b63867aa212b5d50ae666b80df2c266a60f0e97
Parents: c456967
Author: Prabhjyot Singh <pr...@gmail.com>
Authored: Mon Jun 27 17:12:28 2016 +0530
Committer: Alexander Bezzubov <bz...@apache.org>
Committed: Tue Jun 28 00:26:19 2016 +0900

----------------------------------------------------------------------
 .../integration/ParagraphActionsIT.java         | 31 ++++++++++----------
 1 file changed, 15 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4b63867a/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 93d255e..95d5590 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
@@ -204,9 +204,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
           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);
+      clickAndWait(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='moveDown()']"));
 
       collector.checkThat("The paragraph1 value contains",
           driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText(),
@@ -216,9 +214,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
           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);
+      clickAndWait(By.xpath(getParagraphXPath(2) + "//ul/li/a[@ng-click='moveUp()']"));
 
       collector.checkThat("The paragraph1 value contains",
           driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'editor')]")).getText(),
@@ -247,7 +243,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
       setTextOfParagraph(1, "println (\"abcd\")");
 
       driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click();
-      driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='toggleEnableDisable()']")).click();
+      clickAndWait(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='toggleEnableDisable()']"));
       collector.checkThat("The play button class was ",
           driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-control-play']")).isDisplayed(), CoreMatchers.equalTo(false)
       );
@@ -291,7 +287,8 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
           driver.findElement(By.xpath(xpathToOutputField)).getText(),
           CoreMatchers.equalTo("abcd"));
       driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click();
-      driver.findElement(By.xpath(getParagraphXPath(1) + "//ul/li/a[@ng-click='clearParagraphOutput()']")).click();
+      clickAndWait(By.xpath(getParagraphXPath(1) +
+          "//ul/li/a[@ng-click='clearParagraphOutput()']"));
       collector.checkThat("After Clear  Output field contains ",
           driver.findElement(By.xpath(xpathToOutputField)).getText(),
           CoreMatchers.equalTo(""));
@@ -317,7 +314,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
           driver.findElement(By.xpath("//div[contains(@class,'col-md-12')]")).isDisplayed(),
           CoreMatchers.equalTo(true));
       for (Integer newWidth = 1; newWidth <= 11; newWidth++) {
-        driver.findElement(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']")).click();
+        clickAndWait(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']"));
         String visibleText = newWidth.toString();
         new Select(driver.findElement(By.xpath(getParagraphXPath(1)
             + "//ul/li/a/form/select[(@ng-change='changeColWidth()')]"))).selectByVisibleText(visibleText);
@@ -349,22 +346,23 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
       collector.checkThat("Before Show Title : The title field contains",
           driver.findElement(By.xpath(xpathToTitle)).getText(),
           CoreMatchers.equalTo(""));
-      driver.findElement(By.xpath(xpathToSettingIcon)).click();
+
+      clickAndWait(By.xpath(xpathToSettingIcon));
       collector.checkThat("Before Show Title : The title option in option panel of paragraph is labeled as  ",
           driver.findElement(By.xpath(xpathToShowTitle)).getText(),
           CoreMatchers.equalTo("Show title"));
 
-      driver.findElement(By.xpath(xpathToShowTitle)).click();
+      clickAndWait(By.xpath(xpathToShowTitle));
       collector.checkThat("After Show Title : The title field contains",
           driver.findElement(By.xpath(xpathToTitle)).getText(),
           CoreMatchers.equalTo("Untitled"));
 
-      driver.findElement(By.xpath(xpathToSettingIcon)).click();
+      clickAndWait(By.xpath(xpathToSettingIcon));
       collector.checkThat("After Show Title : The title option in option panel of paragraph is labeled as",
           driver.findElement(By.xpath(xpathToHideTitle)).getText(),
           CoreMatchers.equalTo("Hide title"));
 
-      driver.findElement(By.xpath(xpathToHideTitle)).click();
+      clickAndWait(By.xpath(xpathToHideTitle));
       collector.checkThat("After Hide Title : The title field contains",
           driver.findElement(By.xpath(xpathToTitle)).getText(),
           CoreMatchers.equalTo(""));
@@ -373,6 +371,7 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
 
       driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@class, 'title')]")).click();
       driver.findElement(By.xpath(getParagraphXPath(1) + "//input")).sendKeys("NEW TITLE" + Keys.ENTER);
+      ZeppelinITUtils.sleep(500, false);
       collector.checkThat("After Editing the Title : The title field contains ",
           driver.findElement(By.xpath(xpathToTitle)).getText(),
           CoreMatchers.equalTo("NEW TITLE"));
@@ -410,15 +409,15 @@ public class ParagraphActionsIT extends AbstractZeppelinIT {
       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();
+      clickAndWait(By.xpath(xpathToShowLineNumberButton));
       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();
+      clickAndWait(By.xpath(getParagraphXPath(1) + "//span[@class='icon-settings']"));
       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();
+      clickAndWait(By.xpath(xpathToHideLineNumberButton));
       collector.checkThat("After \"Hide line number\" the Line Number is Enabled",
           driver.findElement(By.xpath(xpathToLineNumberField)).isDisplayed(),
           CoreMatchers.equalTo(false));