]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove browser warning when running tests locally on Chrome (#14319)
authorDmitrii Rogozin <dmitrii@vaadin.com>
Tue, 29 Jul 2014 08:05:51 +0000 (11:05 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 30 Jul 2014 08:47:05 +0000 (08:47 +0000)
Change-Id: If621e342f6680eeb6ae0aeb3f2dc38e8160316c8

uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java

index 15ca97f701d7b33958e9e144d05eba250492fc72..ff824ad98a3302b5df090865ec99273a72645aa5 100644 (file)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2000-2013 Vaadind Ltd.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -28,6 +28,7 @@ import java.util.Properties;
 
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.chrome.ChromeOptions;
 import org.openqa.selenium.firefox.FirefoxBinary;
 import org.openqa.selenium.firefox.FirefoxDriver;
 import org.openqa.selenium.phantomjs.PhantomJSDriver;
@@ -41,7 +42,7 @@ import com.vaadin.tests.tb3.MultiBrowserTest.Browser;
  * Provides values for parameters which depend on where the test is run.
  * Parameters should be configured in work/eclipse-run-selected-test.properties.
  * A template is available in uitest/.
- * 
+ *
  * @author Vaadin Ltd
  */
 public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
@@ -105,7 +106,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
 
     /**
      * Gets the hostname that tests are configured to use.
-     * 
+     *
      * @return the host name configuration value
      */
     public static String getConfiguredDeploymentHostname() {
@@ -125,7 +126,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
 
     /**
      * Gets the port that tests are configured to use.
-     * 
+     *
      * @return the port configuration value
      */
     public static int getConfiguredDeploymentPort() {
@@ -142,7 +143,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
     /**
      * Tries to automatically determine the IP address of the machine the test
      * is running on.
-     * 
+     *
      * @return An IP address of one of the network interfaces in the machine.
      * @throws RuntimeException
      *             if there was an error or no IP was found
@@ -179,7 +180,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see com.vaadin.tests.tb3.AbstractTB3Test#setupLocalDriver()
      */
     @Override
@@ -209,7 +210,13 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
                                 + " containing the path of your local ChromeDriver installation.");
             }
             System.setProperty("webdriver.chrome.driver", chromeDriverPath);
-            driver = new ChromeDriver();
+
+            // Tells chrome not to show warning
+            // "You are using an unsupported command-line flag: --ignore-certifcate-errors".
+            // #14319
+            ChromeOptions options = new ChromeOptions();
+            options.addArguments("--test-type ");
+            driver = new ChromeDriver(options);
         } else if (BrowserUtil.isSafari(desiredCapabilities)) {
             driver = new SafariDriver();
         } else if (BrowserUtil.isPhantomJS(desiredCapabilities)) {