From: Dmitrii Rogozin Date: Tue, 29 Jul 2014 08:05:51 +0000 (+0300) Subject: Remove browser warning when running tests locally on Chrome (#14319) X-Git-Tag: 7.3.0.rc1~11^2~84 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2f5df41f2ec6b3b4a3be0ffc454d47c4502a8364;p=vaadin-framework.git Remove browser warning when running tests locally on Chrome (#14319) Change-Id: If621e342f6680eeb6ae0aeb3f2dc38e8160316c8 --- diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 15ca97f701..ff824ad98a 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -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)) {