geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [11/50] [abbrv] geode git commit: GEODE-2112: UITests actually take screenshots on failure
Date Wed, 14 Dec 2016 17:57:26 GMT
GEODE-2112: UITests actually take screenshots on failure

This closes #301


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

Branch: refs/heads/feature/GEODE-1930
Commit: 67dafd8e81738a32e2fbf0140f310c9936346a20
Parents: 0494b31
Author: Jared Stewart <jstewart@pivotal.io>
Authored: Thu Dec 1 11:01:09 2016 -0800
Committer: Kirk Lund <klund@apache.org>
Committed: Wed Dec 7 15:37:15 2016 -0800

----------------------------------------------------------------------
 .../tests/rules/ScreenshotOnFailureRule.java    |  2 +-
 .../tools/pulse/tests/rules/WebDriverRule.java  |  5 ----
 .../pulse/tests/ui/PulseAnonymousUserTest.java  | 28 +++++---------------
 .../tools/pulse/tests/ui/PulseAuthTest.java     |  6 ++++-
 .../pulse/tests/ui/PulseAutomatedTest.java      |  5 ++++
 .../tools/pulse/tests/ui/PulseNoAuthTest.java   |  6 ++++-
 6 files changed, 23 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/67dafd8e/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ScreenshotOnFailureRule.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ScreenshotOnFailureRule.java
b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ScreenshotOnFailureRule.java
index 3728015..91465f0 100644
--- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ScreenshotOnFailureRule.java
+++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/ScreenshotOnFailureRule.java
@@ -47,7 +47,7 @@ public class ScreenshotOnFailureRule extends TestWatcher {
       try {
         File screenshot = new File("build/screenshots/" + screenshotName + ".png");
         FileUtils.copyFile(tempFile, screenshot);
-        System.err.println("Screenshot saved to: " + screenshot.getCanonicalPath());
+        System.out.println("Screenshot saved to: " + screenshot.getCanonicalPath());
       } catch (IOException e) {
         throw new Error(e);
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/67dafd8e/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/WebDriverRule.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/WebDriverRule.java
b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/WebDriverRule.java
index 03d91ab..e273557 100644
--- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/WebDriverRule.java
+++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/rules/WebDriverRule.java
@@ -52,15 +52,10 @@ public class WebDriverRule extends ExternalResource {
     return this.driver;
   }
 
-  @Rule
-  public ScreenshotOnFailureRule screenshotOnFailureRule =
-      new ScreenshotOnFailureRule(() -> driver);
-
   public String getPulseURL() {
     return pulseUrl;
   }
 
-
   @Override
   protected void before() throws Throwable {
     setUpWebDriver();

http://git-wip-us.apache.org/repos/asf/geode/blob/67dafd8e/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAnonymousUserTest.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAnonymousUserTest.java
b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAnonymousUserTest.java
index 4d255c8..680b11f 100644
--- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAnonymousUserTest.java
+++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAnonymousUserTest.java
@@ -16,18 +16,13 @@
 
 package org.apache.geode.tools.pulse.tests.ui;
 
-import static org.assertj.core.api.Assertions.*;
+import static org.assertj.core.api.Assertions.assertThat;
 
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import com.jayway.awaitility.Awaitility;
+import org.apache.geode.test.junit.categories.UITest;
+import org.apache.geode.tools.pulse.tests.rules.ScreenshotOnFailureRule;
 import org.apache.geode.tools.pulse.tests.rules.ServerRule;
 import org.apache.geode.tools.pulse.tests.rules.WebDriverRule;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.FixMethodOrder;
 import org.junit.Rule;
@@ -35,18 +30,7 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runners.MethodSorters;
 import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
-import org.openqa.selenium.phantomjs.PhantomJSDriver;
-import org.openqa.selenium.remote.DesiredCapabilities;
-import org.openqa.selenium.support.ui.ExpectedCondition;
-import org.openqa.selenium.support.ui.WebDriverWait;
-
-import org.apache.geode.internal.admin.SSLConfig;
-import org.apache.geode.management.internal.JettyHelper;
-import org.apache.geode.test.junit.categories.UITest;
-import org.apache.geode.tools.pulse.tests.PulseTestLocators;
-import org.apache.geode.tools.pulse.tests.Server;
 
 @Category(UITest.class)
 @FixMethodOrder(MethodSorters.JVM)
@@ -58,6 +42,10 @@ public class PulseAnonymousUserTest {
   @Rule
   public WebDriverRule webDriverRule = new WebDriverRule(serverRule.getPulseURL());
 
+  @Rule
+  public ScreenshotOnFailureRule screenshotOnFailureRule =
+      new ScreenshotOnFailureRule(() -> webDriverRule.getDriver());
+
   @Before
   public void setup() {
     webDriverRule.getDriver().get(serverRule.getPulseURL() + "/clusterDetail.html");
@@ -66,8 +54,6 @@ public class PulseAnonymousUserTest {
   @Test
   public void userCanGetToPulseLoginPage() {
     webDriverRule.getDriver().get(serverRule.getPulseURL() + "/Login.html");
-    System.err.println("Pulse url: " + serverRule.getPulseURL());
-    System.err.println(webDriverRule.getDriver().getPageSource().toString());
 
     WebElement userNameElement = webDriverRule.getDriver().findElement(By.id("user_name"));
     WebElement passwordElement = webDriverRule.getDriver().findElement(By.id("user_password"));

http://git-wip-us.apache.org/repos/asf/geode/blob/67dafd8e/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAuthTest.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAuthTest.java
b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAuthTest.java
index fc9719d..4a82d1b 100644
--- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAuthTest.java
+++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAuthTest.java
@@ -16,10 +16,10 @@
 package org.apache.geode.tools.pulse.tests.ui;
 
 import org.apache.geode.test.junit.categories.UITest;
+import org.apache.geode.tools.pulse.tests.rules.ScreenshotOnFailureRule;
 import org.apache.geode.tools.pulse.tests.rules.ServerRule;
 import org.apache.geode.tools.pulse.tests.rules.WebDriverRule;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.FixMethodOrder;
 import org.junit.Rule;
@@ -38,6 +38,10 @@ public class PulseAuthTest extends PulseBase {
   public WebDriverRule webDriverRule =
       new WebDriverRule("pulseUser", "12345", serverRule.getPulseURL());
 
+  @Rule
+  public ScreenshotOnFailureRule screenshotOnFailureRule =
+      new ScreenshotOnFailureRule(this::getWebDriver);
+
   @Override
   public WebDriver getWebDriver() {
     return webDriverRule.getDriver();

http://git-wip-us.apache.org/repos/asf/geode/blob/67dafd8e/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAutomatedTest.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAutomatedTest.java
b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAutomatedTest.java
index 8df0543..7c42e44 100644
--- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAutomatedTest.java
+++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseAutomatedTest.java
@@ -28,6 +28,7 @@ import java.text.SimpleDateFormat;
 import java.util.List;
 
 import org.apache.geode.tools.pulse.tests.DataBrowserResultLoader;
+import org.apache.geode.tools.pulse.tests.rules.ScreenshotOnFailureRule;
 import org.apache.geode.tools.pulse.tests.rules.ServerRule;
 import org.apache.geode.tools.pulse.tests.rules.WebDriverRule;
 import org.junit.Assert;
@@ -56,6 +57,10 @@ public class PulseAutomatedTest extends PulseBase {
   public WebDriverRule webDriverRule =
       new WebDriverRule("pulseUser", "12345", serverRule.getPulseURL());
 
+  @Rule
+  public ScreenshotOnFailureRule screenshotOnFailureRule =
+      new ScreenshotOnFailureRule(this::getWebDriver);
+
   @Override
   public WebDriver getWebDriver() {
     return webDriverRule.getDriver();

http://git-wip-us.apache.org/repos/asf/geode/blob/67dafd8e/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseNoAuthTest.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseNoAuthTest.java
b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseNoAuthTest.java
index adcb50f..03265ef 100644
--- a/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseNoAuthTest.java
+++ b/geode-pulse/src/test/java/org/apache/geode/tools/pulse/tests/ui/PulseNoAuthTest.java
@@ -16,10 +16,10 @@
 package org.apache.geode.tools.pulse.tests.ui;
 
 import org.apache.geode.test.junit.categories.UITest;
+import org.apache.geode.tools.pulse.tests.rules.ScreenshotOnFailureRule;
 import org.apache.geode.tools.pulse.tests.rules.ServerRule;
 import org.apache.geode.tools.pulse.tests.rules.WebDriverRule;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.FixMethodOrder;
 import org.junit.Rule;
@@ -38,6 +38,10 @@ public class PulseNoAuthTest extends PulseBase {
   public WebDriverRule webDriverRule =
       new WebDriverRule("admin", "admin", serverRule.getPulseURL());
 
+  @Rule
+  public ScreenshotOnFailureRule screenshotOnFailureRule =
+      new ScreenshotOnFailureRule(this::getWebDriver);
+
   @Override
   public WebDriver getWebDriver() {
     return webDriverRule.getDriver();


Mime
View raw message