From e68a4b82703a0dc4d897e2e99d55d1a10b27b495 Mon Sep 17 00:00:00 2001 From: Prachi Yadav Date: Thu, 11 Feb 2016 17:05:35 +0530 Subject: [PATCH] modified Transaction tab test --- ...kularApplicationTransactionConstatnts.java | 2 +- .../hawkularApplicationTransactionPage.java | 25 +++++++------------ .../tests/hawkularAppTransactionTest.java | 3 +++ 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/qe/hawkular/element/hawkularApplicationTransactionConstatnts.java b/src/main/java/org/qe/hawkular/element/hawkularApplicationTransactionConstatnts.java index 3af773f..ca57779 100644 --- a/src/main/java/org/qe/hawkular/element/hawkularApplicationTransactionConstatnts.java +++ b/src/main/java/org/qe/hawkular/element/hawkularApplicationTransactionConstatnts.java @@ -10,7 +10,7 @@ public class hawkularApplicationTransactionConstatnts { public static final By transactionMetrics= By.xpath(".//*[@id='hk-deployments']/div[2]/div[1]/div[2]/h3"); - public static final By transactionGraph= By.xpath(".//*[@id='hk-deployments']/div[2]/div[1]/div[3]/div[2]/div/hawkular-chart/svg"); + public static final By transactionGraph= By.xpath(".//*[@id='hk-deployments']/div[2]/div[1]/div[3]/div[2]/div"); public static final By transactionsAlert= By.xpath(".//*[@id='hk-deployments']/div[2]/div[2]/div/div[1]/h2"); public static final By transactionStatus= By.xpath(".//*[@id='hk-deployments']/div[1]/h3"); diff --git a/src/main/java/org/qe/hawkular/page/hawkularApplicationTransactionPage.java b/src/main/java/org/qe/hawkular/page/hawkularApplicationTransactionPage.java index 7a0b4ca..9ad13bd 100644 --- a/src/main/java/org/qe/hawkular/page/hawkularApplicationTransactionPage.java +++ b/src/main/java/org/qe/hawkular/page/hawkularApplicationTransactionPage.java @@ -1,5 +1,7 @@ package org.qe.hawkular.page; +import junit.framework.Assert; + import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.qe.hawkular.element.HawkularAppServerPageConstants; @@ -17,28 +19,19 @@ public hawkularApplicationTransactionPage(WebDriver driver) { } - By ApplicationServerTab= HawkularApplicationOverviewConstants.ApplicationServerTab; - - By localWildfyServerLink= HawkularAppServerPageConstants.localWildfyServerLink; - By appserverTransactionsTabLink= HawkularAppServerPageConstants.appserverTransactionsTabLink; - - By transactionMetrics=hawkularApplicationTransactionConstatnts.transactionMetrics; - By transactionGraph=hawkularApplicationTransactionConstatnts.transactionGraph; - By transactionsAlert=hawkularApplicationTransactionConstatnts.transactionsAlert; - By transactionStatus=hawkularApplicationTransactionConstatnts.transactionStatus; public void checkAppTransaction() { HawkularUtils utils = new HawkularUtils(driver); - utils.navigateTo(ApplicationServerTab); - utils.navigateTo(localWildfyServerLink); - utils.navigateTo(appserverTransactionsTabLink); - utils.waitForElementPresent(transactionMetrics); - // utils.waitForElementPresent(transactionGraph); - utils.waitForElementPresent(transactionsAlert); - utils.waitForElementPresent(transactionStatus); + utils.navigateTo(HawkularApplicationOverviewConstants.ApplicationServerTab); + utils.navigateTo( HawkularAppServerPageConstants.localWildfyServerLink); + utils.navigateTo( HawkularAppServerPageConstants.appserverTransactionsTabLink); + Assert.assertTrue(utils.waitForElementPresent(hawkularApplicationTransactionConstatnts.transactionMetrics)); + Assert.assertTrue(utils.waitForElementPresent(hawkularApplicationTransactionConstatnts.transactionGraph)); + Assert.assertTrue(utils.waitForElementPresent(hawkularApplicationTransactionConstatnts.transactionsAlert)); + Assert.assertTrue(utils.waitForElementPresent(hawkularApplicationTransactionConstatnts.transactionStatus)); } diff --git a/src/test/java/org/qe/hawkular/tests/hawkularAppTransactionTest.java b/src/test/java/org/qe/hawkular/tests/hawkularAppTransactionTest.java index 325ade6..7593cd4 100644 --- a/src/test/java/org/qe/hawkular/tests/hawkularAppTransactionTest.java +++ b/src/test/java/org/qe/hawkular/tests/hawkularAppTransactionTest.java @@ -39,6 +39,9 @@ public void closeSession() { @Test public void hawkularApplicationTransactionTest() throws Exception { + + _logger.info("verifying the newly added transaction tab and its Element"); + driver = hawkularLoginToDeployments(); hawkularApplicationTransactionPage verify = new hawkularApplicationTransactionPage(driver);