falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rostafiyc...@apache.org
Subject [1/3] falcon git commit: FALCON-1289 Select instances again after performing action on entity page. Contributed by Ruslan Ostafiychuk
Date Thu, 02 Jul 2015 16:14:03 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 5422ede87 -> 867a24a6a


FALCON-1289 Select instances again after performing action on entity page. Contributed by
Ruslan Ostafiychuk


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

Branch: refs/heads/master
Commit: ccbebbacd0a0957f942b69798a7f171c46a85f65
Parents: 5422ede
Author: Ruslan Ostafiychuk <rostafiychuk@apache.org>
Authored: Thu Jul 2 19:05:58 2015 +0300
Committer: Ruslan Ostafiychuk <rostafiychuk@apache.org>
Committed: Thu Jul 2 19:05:58 2015 +0300

----------------------------------------------------------------------
 falcon-regression/CHANGES.txt                   |  2 ++
 .../falcon/regression/ui/search/EntityPage.java | 17 ++++----------
 .../regression/searchUI/EntityPageTest.java     | 24 ++++++++++++--------
 3 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/ccbebbac/falcon-regression/CHANGES.txt
----------------------------------------------------------------------
diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt
index 75c6ad0..9149ed4 100644
--- a/falcon-regression/CHANGES.txt
+++ b/falcon-regression/CHANGES.txt
@@ -355,6 +355,8 @@ Trunk (Unreleased)
    FALCON-681 delete duplicate feed retention test from falcon regression (SamarthG)
 
   BUG FIXES
+   FALCON-1289 Select instances again after performing action on entity page (Ruslan Ostafiychuk)
+
    FALCON-1292 Avoid usage of hard coded feed names in Bundle class (Paul Isaychuk)
 
    FALCON-1281 Fix InstancePageTest#testInstancePageStatusWaitingRunning (Namit Maheshwari
via Ruslan Ostafiychuk)

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccbebbac/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/EntityPage.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/EntityPage.java
b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/EntityPage.java
index 6a71cab..cdd181b 100644
--- a/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/EntityPage.java
+++ b/falcon-regression/merlin/src/main/java/org/apache/falcon/regression/ui/search/EntityPage.java
@@ -65,9 +65,9 @@ public class EntityPage extends AbstractSearchPage {
      */
     public enum InstanceAction {
         Log,
-        Suspend,
         Resume,
         Rerun,
+        Suspend,
         Kill
     }
 
@@ -400,6 +400,10 @@ public class EntityPage extends AbstractSearchPage {
             softAssert.assertAll();
         }
     }
+    public void performActionOnSelectedInstances(InstanceAction instanceAction) {
+        driver.findElement(By.xpath(String.format("//td/div[%d]", instanceAction.ordinal()
+ 1))).click();
+        waitForAngularToFinish();
+    }
 
     public InstanceSummary getInstanceSummary() {
         return new InstanceSummary(this);
@@ -426,17 +430,6 @@ public class EntityPage extends AbstractSearchPage {
             return instanceListBox.findElements(By.xpath(".//tbody/tr"));
         }
 
-        public void performActionOnSelectedInstances(InstanceAction instanceAction) {
-            final List<WebElement> summaryTableBodyParts = getTableRows();
-            final WebElement actionRibbon = summaryTableBodyParts.get(0);
-            for (WebElement element : actionRibbon.findElements(By.xpath("./td/div"))) {
-                if (InstanceAction.valueOf(element.getText()) == instanceAction) {
-                    element.click();
-                    return;
-                }
-            }
-        }
-
         /**
          * Get instance summary starting for all the pages.
          * @return instance summary

http://git-wip-us.apache.org/repos/asf/falcon/blob/ccbebbac/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntityPageTest.java
----------------------------------------------------------------------
diff --git a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntityPageTest.java
b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntityPageTest.java
index 48239c2..b09c04f 100644
--- a/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntityPageTest.java
+++ b/falcon-regression/merlin/src/test/java/org/apache/falcon/regression/searchUI/EntityPageTest.java
@@ -37,6 +37,7 @@ import org.apache.falcon.regression.core.util.OozieUtil;
 import org.apache.falcon.regression.core.util.TimeUtil;
 import org.apache.falcon.regression.testHelper.BaseUITestClass;
 import org.apache.falcon.regression.ui.search.EntityPage;
+import org.apache.falcon.regression.ui.search.EntityPage.InstanceAction;
 import org.apache.falcon.regression.ui.search.LoginPage;
 import org.apache.falcon.regression.ui.search.SearchPage;
 import org.apache.falcon.resource.InstancesResult;
@@ -444,11 +445,10 @@ public class EntityPageTest extends BaseUITestClass {
         final EntityPage.InstanceSummary displayedSummary = entityPage.getInstanceSummary();
 
         //suspend instances through ui
-        final List<EntityPage.OneInstanceSummary> runningSummary = displayedSummary.getSummary();
-        for (EntityPage.OneInstanceSummary oneInstanceSummary : runningSummary) {
+        for (EntityPage.OneInstanceSummary oneInstanceSummary : displayedSummary.getSummary())
{
             oneInstanceSummary.clickCheckBox();
         }
-        displayedSummary.performActionOnSelectedInstances(EntityPage.InstanceAction.Suspend);
+        entityPage.performActionOnSelectedInstances(InstanceAction.Suspend);
         final List<EntityPage.OneInstanceSummary> suspendedSummary = displayedSummary.getSummary();
         Assert.assertEquals(suspendedSummary.get(0).getStatus(), "SUSPENDED",
             "Expecting first instance to be suspended");
@@ -460,7 +460,10 @@ public class EntityPageTest extends BaseUITestClass {
         displayedSummary.checkSummary(apiSuspendedSummary.getInstances());
 
         //resume instances through ui
-        displayedSummary.performActionOnSelectedInstances(EntityPage.InstanceAction.Resume);
+        for (EntityPage.OneInstanceSummary oneInstanceSummary : suspendedSummary) {
+            oneInstanceSummary.clickCheckBox();
+        }
+        entityPage.performActionOnSelectedInstances(InstanceAction.Resume);
         final List<EntityPage.OneInstanceSummary> resumedSummary = displayedSummary.getSummary();
         Assert.assertEquals(resumedSummary.get(0).getStatus(), "RUNNING",
             "Expecting first instance to be running");
@@ -506,7 +509,7 @@ public class EntityPageTest extends BaseUITestClass {
         for (EntityPage.OneInstanceSummary oneInstanceSummary : runningSummary) {
             oneInstanceSummary.clickCheckBox();
         }
-        displayedSummary.performActionOnSelectedInstances(EntityPage.InstanceAction.Kill);
+        entityPage.performActionOnSelectedInstances(InstanceAction.Kill);
         final List<EntityPage.OneInstanceSummary> killedSummary = displayedSummary.getSummary();
         Assert.assertEquals(killedSummary.get(0).getStatus(), "KILLED",
             "Expecting first instance to be killed");
@@ -518,7 +521,10 @@ public class EntityPageTest extends BaseUITestClass {
         displayedSummary.checkSummary(apiKilledSummary.getInstances());
 
         //rerun instances through ui
-        displayedSummary.performActionOnSelectedInstances(EntityPage.InstanceAction.Rerun);
+        for (EntityPage.OneInstanceSummary oneInstanceSummary : killedSummary) {
+            oneInstanceSummary.clickCheckBox();
+        }
+        entityPage.performActionOnSelectedInstances(InstanceAction.Rerun);
         final List<EntityPage.OneInstanceSummary> rerunSummary = displayedSummary.getSummary();
         Assert.assertEquals(rerunSummary.get(0).getStatus(), "RUNNING",
             "Expecting first instance to be running");
@@ -563,20 +569,20 @@ public class EntityPageTest extends BaseUITestClass {
 
         //kill instances through ui
         final List<EntityPage.OneInstanceSummary> runningSummary = displayedSummary.getSummary();
-        displayedSummary.performActionOnSelectedInstances(EntityPage.InstanceAction.Log);
+        entityPage.performActionOnSelectedInstances(InstanceAction.Log);
         Assert.assertFalse(getDriver().getCurrentUrl().contains("oozie"),
             "No instance is selected, so, log button should be disabled. "
                 + "Clicking instance log button should not take user to oozie page.");
         for (EntityPage.OneInstanceSummary oneInstanceSummary : runningSummary) {
             oneInstanceSummary.clickCheckBox();
         }
-        displayedSummary.performActionOnSelectedInstances(EntityPage.InstanceAction.Log);
+        entityPage.performActionOnSelectedInstances(InstanceAction.Log);
         Assert.assertFalse(getDriver().getCurrentUrl().contains("oozie"),
             "Two instances are selected, so, log button should be disabled. "
                 + "Clicking instance log button should not take user to oozie page.");
         runningSummary.get(1).clickCheckBox();
         //only first checkbox is ticked
-        displayedSummary.performActionOnSelectedInstances(EntityPage.InstanceAction.Log);
+        entityPage.performActionOnSelectedInstances(InstanceAction.Log);
         final String nominalTimeOfSelectedInstance = runningSummary.get(0).getNominalTime();
         final InstancesResult processInstanceLogs = prism.getProcessHelper()
             .getProcessInstanceLogs(process.getName(),


Mime
View raw message