Quantcast

[HtmlUnit] SVN: [13793] trunk/htmlunit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] SVN: [13793] trunk/htmlunit

asashour-2
Revision: 13793
          http://sourceforge.net/p/htmlunit/code/13793
Author:   asashour
Date:     2017-03-16 09:30:27 +0000 (Thu, 16 Mar 2017)
Log Message:
-----------
upgarde selenium

Modified Paths:
--------------
    trunk/htmlunit/pom.xml
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java

Modified: trunk/htmlunit/pom.xml
===================================================================
--- trunk/htmlunit/pom.xml 2017-03-16 09:11:55 UTC (rev 13792)
+++ trunk/htmlunit/pom.xml 2017-03-16 09:30:27 UTC (rev 13793)
@@ -888,7 +888,7 @@
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-api</artifactId>
-            <version>3.1.0</version>
+            <version>3.3.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -906,31 +906,31 @@
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-ie-driver</artifactId>
-            <version>3.1.0</version>
+            <version>3.3.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-firefox-driver</artifactId>
-            <version>3.1.0</version>
+            <version>3.3.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-chrome-driver</artifactId>
-            <version>3.1.0</version>
+            <version>3.3.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-edge-driver</artifactId>
-            <version>3.1.0</version>
+            <version>3.3.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-support</artifactId>
-            <version>3.1.0</version>
+            <version>3.3.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java 2017-03-16 09:11:55 UTC (rev 13792)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ErrorOutputChecker.java 2017-03-16 09:30:27 UTC (rev 13793)
@@ -36,20 +36,21 @@
 public class ErrorOutputChecker implements TestRule {
     private PrintStream originalErr_;
     private final ByteArrayOutputStream baos_ = new ByteArrayOutputStream();
-    private static final Pattern WEB_DRIVER_CHROME_MSG =
+    private static final Pattern[] PATTERNS = {
             Pattern.compile("Starting ChromeDriver 2\\.28\\.455520 ?\\(?[0-9a-f]*\\)? on port \\d*\r?\n"
-                    + "Only local connections are allowed\\.\r?\n");
-    private static final Pattern WEB_DRIVER_IE_MSG =
+                    + "Only local connections are allowed\\.\r?\n"),
+            Pattern.compile(".*FirefoxOptions toCapabilities\r?\n"),
+            Pattern.compile(".*Preferring the firefox binary in these options \\(.*\\)\r?\n"),
             Pattern.compile("Started InternetExplorerDriver server \\(\\d\\d\\-bit\\)\r?\n"
                     + "2\\.53\\.1\\.0\r?\n"
                     + "Listening on port \\d*\r?\n"
-                    + "Only local connections are allowed\r?\n");
-    private static final Pattern WEB_DRIVER_EDGE_MSG1 =
-            Pattern.compile(".*Listening on http://localhost:\\d*/ \r\r?\n");
-    private static final Pattern WEB_DRIVER_EDGE_MSG2 =
-            Pattern.compile(".*Stopping server.\r\r?\n");
-    private static final Pattern WEB_DRIVER_IGNORE_MSG =
-            Pattern.compile(".*ProtocolHandshake createSession\r?\nINFO: Detected dialect: OSS\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: OSS\r?\n")
+    };
 
     /**
      * {@inheritDoc}
@@ -76,12 +77,10 @@
         if (baos_.size() != 0) {
             String output = baos_.toString();
 
-            // remove webdriver message
-            output = WEB_DRIVER_CHROME_MSG.matcher(output).replaceAll("");
-            output = WEB_DRIVER_IE_MSG.matcher(output).replaceAll("");
-            output = WEB_DRIVER_EDGE_MSG1.matcher(output).replaceAll("");
-            output = WEB_DRIVER_EDGE_MSG2.matcher(output).replaceAll("");
-            output = WEB_DRIVER_IGNORE_MSG.matcher(output).replaceAll("");
+            // remove webdriver messages
+            for (Pattern pattern : PATTERNS) {
+                output = pattern.matcher(output).replaceAll("");
+            }
 
             if (!output.isEmpty()) {
                 if (output.contains("ChromeDriver")) {

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java 2017-03-16 09:11:55 UTC (rev 13792)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebDriverTestCase.java 2017-03-16 09:30:27 UTC (rev 13793)
@@ -63,9 +63,8 @@
 import org.openqa.selenium.chrome.ChromeDriver;
 import org.openqa.selenium.chrome.ChromeDriverService;
 import org.openqa.selenium.edge.EdgeDriver;
-import org.openqa.selenium.firefox.FirefoxBinary;
 import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.firefox.FirefoxProfile;
+import org.openqa.selenium.firefox.FirefoxOptions;
 import org.openqa.selenium.htmlunit.HtmlUnitDriver;
 import org.openqa.selenium.htmlunit.HtmlUnitWebElement;
 import org.openqa.selenium.ie.InternetExplorerDriver;
@@ -88,7 +87,7 @@
  * <pre>
    browsers=hu,ff45,ie
    chrome.bin=/path/to/chromedriver                     [Unix-like]
-   ff45.bin=/usr/bin/firefox                            [Unix-like]
+   ff52.bin=/usr/bin/firefox                            [Unix-like]
    ie.bin=C:\\path\\to\\32bit\\IEDriverServer.exe       [Windows]
    edge.bin=C:\\path\\to\\MicrosoftWebDriver.exe        [Windows]
    autofix=true
@@ -96,11 +95,12 @@
  * The file could contain some properties:
  * <ul>
  *   <li>browsers: is a comma separated list contains any combination of "hu" (for HtmlUnit with all browser versions),
- *   "hu-ie", "hu-ff45", "ff45", "ie", "chrome", which will be used to drive real browsers</li>
+ *   "hu-ie", "hu-ff52", "ff52", "ie", "chrome", which will be used to drive real browsers</li>
  *
  *   <li>chrome.bin (mandatory if it does not exist in the <i>path</i>): is the location of the ChromeDriver binary (see
  *   <a href="http://chromedriver.storage.googleapis.com/index.html">Chrome Driver downloads</a>)</li>
  *   <li>ff45.bin (optional): is the location of the FF binary, in Windows use double back-slashes</li>
+ *   <li>ff52.bin (optional): is the location of the FF binary, in Windows use double back-slashes</li>
  *   <li>ie.bin (mandatory if it does not exist in the <i>path</i>): is the location of the IEDriverServer binary (see
  *   <a href="http://selenium-release.storage.googleapis.com/index.html">IEDriverServer downloads</a>)</li>
  *   <li>edge.bin (mandatory if it does not exist in the <i>path</i>): is the location of the MicrosoftWebDriver binary
@@ -141,6 +141,7 @@
     private static String EDGE_BIN_;
     private static String IE_BIN_;
     private static String FF45_BIN_;
+    private static String FF52_BIN_;
 
     /** The driver cache. */
     protected static final Map<BrowserVersion, WebDriver> WEB_DRIVERS_ = new HashMap<>();
@@ -190,6 +191,7 @@
                     EDGE_BIN_ = properties.getProperty("edge.bin");
                     IE_BIN_ = properties.getProperty("ie.bin");
                     FF45_BIN_ = properties.getProperty("ff45.bin");
+                    FF52_BIN_ = properties.getProperty("ff52.bin");
 
                     final boolean autofix = Boolean.parseBoolean(properties.getProperty("autofix"));
                     System.setProperty(AUTOFIX_, Boolean.toString(autofix));
@@ -423,11 +425,22 @@
                 System.setProperty("webdriver.firefox.marionette", "false");
 
                 if (FF45_BIN_ != null) {
-                    return new FirefoxDriver(new FirefoxBinary(new File(FF45_BIN_)), new FirefoxProfile());
+                    final FirefoxOptions options = new FirefoxOptions();
+                    options.setBinary(FF45_BIN_);
+                    return new FirefoxDriver(options);
                 }
                 return new FirefoxDriver();
             }
 
+            if (BrowserVersion.FIREFOX_52 == getBrowserVersion()) {
+                if (FF52_BIN_ != null) {
+                    final FirefoxOptions options = new FirefoxOptions();
+                    options.setBinary(FF52_BIN_);
+                    return new FirefoxDriver(options);
+                }
+                return new FirefoxDriver();
+            }
+
             throw new RuntimeException("Unexpected BrowserVersion: " + getBrowserVersion());
         }
         if (webClient_ == null) {


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...