falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject [01/15] falcon git commit: FALCON-1332: Fortify ClusterSetupTest#testRegistryInterface - if checkbox wasn't clicked repeat an attempt contributed by Paul Isaychuk
Date Sat, 08 Aug 2015 14:40:17 GMT
Repository: falcon
Updated Branches:
  refs/heads/0.7 69a5d4414 -> 9ee4cf796


FALCON-1332: Fortify ClusterSetupTest#testRegistryInterface - if checkbox wasn't clicked repeat
an attempt contributed by Paul Isaychuk


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/8de399ce
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/8de399ce
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/8de399ce

Branch: refs/heads/0.7
Commit: 8de399ce1c7fa6164c4f4e751fb425011a3ffab7
Parents: 69a5d44
Author: Raghav Kumar Gautam <raghav@apache.org>
Authored: Thu Jul 30 14:45:46 2015 -0700
Committer: Ajay Yadav <ajay.yadav@inmobi.com>
Committed: Sat Aug 8 20:06:29 2015 +0530

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                     |  3 +++
 .../regression/ui/search/AbstractSearchPage.java  | 18 ++++++++++++++++++
 .../regression/ui/search/ClusterWizardPage.java   |  9 +++++++--
 .../regression/searchUI/ClusterSetupTest.java     |  4 ++--
 4 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/8de399ce/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index 01b06c1..73ce75b 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -360,6 +360,9 @@ Trunk (Unreleased)
    FALCON-681 delete duplicate feed retention test from falcon regression (SamarthG)
 
   BUG FIXES
+   FALCON-1332 Fortify ClusterSetupTest#testRegistryInterface - if checkbox wasn't clicked
repeat an attempt
+   (Paul Isaychuk via Raghav Kumar Gautam)
+
    FALCON-1338 Fortify ProcessInstanceRerunTest#testProcessInstanceRerunMultipleSucceeded
(Paul Isaychuk)
 
    FALCON-1318 Method waitForAngularToFinish() should be robust to unresponsive browser (Raghav
Kumar Gautam)

http://git-wip-us.apache.org/repos/asf/falcon/blob/8de399ce/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
index 1a94800..d956549 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/AbstractSearchPage.java
@@ -194,4 +194,22 @@ public abstract class AbstractSearchPage extends Page {
             return false;
         }
     }
+
+    /**
+     * Method imitates click on check box. If click is not performed method retries the click.
+     * @param expectedState whether check box is expected to be enabled or not after click.
+     */
+    protected void clickCheckBoxSecurely(WebElement checkBox, boolean expectedState) {
+        double gap = 0.5;
+        for (int attempt = 1; attempt <= (DEFAULT_TIMEOUT / gap); attempt++) {
+            LOGGER.info("Attempt to click a check box: " + attempt);
+            checkBox.click();
+            if (checkBox.isSelected() == expectedState) {
+                return;
+            }
+            TimeUtil.sleepSeconds(gap);
+        }
+        Assert.fail("Check box state was not changed even in " + DEFAULT_TIMEOUT + " seconds.");
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/8de399ce/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
index dc419a7..0fbfc38 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/ClusterWizardPage.java
@@ -437,8 +437,13 @@ public class ClusterWizardPage extends AbstractSearchPage {
         UIAssert.assertDisplayed(clusterBox, "Cluster box");
     }
 
-    public void checkRegistry() {
-        clusterBox.findElement(By.xpath("//input[@type='checkbox']")).click();
+    /**
+     * Method imitates click on check box.
+     * @param expectedState whether check box is expected to be enabled or not after click.
+     */
+    public void checkRegistry(boolean expectedState) {
+        WebElement checkbox = clusterBox.findElement(By.xpath("//input[@type='checkbox']"));
+        clickCheckBoxSecurely(checkbox, expectedState);
         waitForAngularToFinish();
     }
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/8de399ce/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
index 960bb5c..b0ddcf3 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/ClusterSetupTest.java
@@ -215,9 +215,9 @@ public class ClusterSetupTest extends BaseUITestClass{
     @Test
     public void testRegistryInterface() {
         Assert.assertFalse(clusterSetup.isRegistryEnabled(), "Registry should be disabled.");
-        clusterSetup.checkRegistry();
+        clusterSetup.checkRegistry(true);
         Assert.assertTrue(clusterSetup.isRegistryEnabled(), "Registry should be enabled.");
-        clusterSetup.checkRegistry();
+        clusterSetup.checkRegistry(false);
         Assert.assertFalse(clusterSetup.isRegistryEnabled(), "Registry should be disabled
again.");
     }
 


Mime
View raw message