[HtmlUnit] SVN: [15374] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit

rbri--- via HtmlUnit-develop <[email protected]>
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID <[email protected]>
Revision: 15374
          http://sourceforge.net/p/htmlunit/code/15374
Author:   rbri
Date:     2018-06-20 20:11:04 +0000 (Wed, 20 Jun 2018)
Log Message:
-----------
simplify patterns, check geckodriver version also

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java	2018-06-20 18:42:28 UTC (rev 15373)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java	2018-06-20 20:11:04 UTC (rev 15374)
@@ -37,33 +37,25 @@
     private PrintStream originalErr_;
     private final ByteArrayOutputStream baos_ = new ByteArrayOutputStream();
     private static final Pattern[] PATTERNS = {
+
+            // chrome
             Pattern.compile("Starting ChromeDriver " + ExternalTest.CHROME_DRIVER_.replace(".", "\\.")
                     + "\\.[0-9]+ ?\\(?[0-9a-f]*\\)? on port \\d*\r?\n"
                     + "Only local connections are allowed\\.\r?\n"),
-            Pattern.compile(".*Unable to retrieve document state unexpected alert open\r?\n"),
-            Pattern.compile(".*FirefoxOptions toCapabilities\r?\n"),
-            Pattern.compile(".*Preferring the firefox binary in these options \\(.*\\)\r?\n"),
-            Pattern.compile(".*geckodriver.*\r?\n"),
-            Pattern.compile(".*mozprofile.*\r?\n"),
-            Pattern.compile(".*Marionette.*\r?\n"),
-            Pattern.compile(".*\tDEBUG\t.*\r?\n"),
-            Pattern.compile(".*\taddons\\..*\r?\n"),
-            Pattern.compile("\\*\\*\\* Blocklist::.*\r?\n"),
+
+            // GeckoDriver
+            Pattern.compile("[0-9]*\\sgeckodriver\\sINFO\\sgeckodriver "
+                                + ExternalTest.GECKO_DRIVER_.replace(".", "\\.") + ".*", Pattern.DOTALL),
+            // ie
             Pattern.compile("Started InternetExplorerDriver server \\(\\d\\d\\-bit\\)\r?\n"
                     + "3\\.8\\.0\\.0\r?\n"
                     + "Listening on port \\d*\r?\n"
                     + "Only local connections are allowed\r?\n"),
+
             // edge
             Pattern.compile(".*Listening on http://localhost:\\d*/ \r\r?\n"),
-            // edge
             Pattern.compile(".*Stopping server.\r\r?\n"),
             Pattern.compile(".*ProtocolHandshake createSession\r?\n(INFO|INFORMATION): Detected dialect: .*\r?\n"),
-
-            // FF60 output
-            Pattern.compile("Unable to read VR Path Registry from .*\r\r?\n"),
-            Pattern.compile("JavaScript warning: .*: String.toLowerCase is deprecated;"
-                                + " use String.prototype.toLowerCase instead\r\r?\n")
-
     };
 
     /**

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java	2018-06-20 18:42:28 UTC (rev 15373)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ExternalTest.java	2018-06-20 20:11:04 UTC (rev 15374)
@@ -33,6 +33,8 @@
 import org.apache.commons.io.FileUtils;
 import org.junit.Test;
 
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.DomNodeList;
 import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
 import com.gargoylesoftware.htmlunit.html.HtmlPage;
 import com.gargoylesoftware.htmlunit.html.HtmlTable;
@@ -81,8 +83,11 @@
                     }
                 }
             }
+
             assertVersion("org.sonatype.oss", "oss-parent", "9");
+
             assertChromeDriver();
+            assertGeckoDriver();
         }
     }
 
@@ -107,6 +112,14 @@
         }
     }
 
+    private static void assertGeckoDriver() throws Exception {
+        try (WebClient webClient = getWebClient()) {
+            final HtmlPage page = webClient.getPage("https://github.com/mozilla/geckodriver/releases/latest");
+            final DomNodeList<DomNode> divs = page.querySelectorAll(".release-title");
+            assertEquals("Gecko Driver", divs.get(0).asText(), "v" + GECKO_DRIVER_);
+        }
+    }
+
     /**
      * Tests that the deployed snapshot is not more than two weeks old.
      *


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.