From 7bce900ae8c85e9d3d8dfdf36ca76e58a8cb421d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boni=20Garc=C3=ADa?= Date: Mon, 21 Sep 2020 17:01:37 +0200 Subject: [PATCH] Include test example using Chrome beta and .browserPath() (issue #548) --- .../wdm/test/chrome/ChromeBetaTest.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/test/java/io/github/bonigarcia/wdm/test/chrome/ChromeBetaTest.java diff --git a/src/test/java/io/github/bonigarcia/wdm/test/chrome/ChromeBetaTest.java b/src/test/java/io/github/bonigarcia/wdm/test/chrome/ChromeBetaTest.java new file mode 100644 index 000000000..05c4306a8 --- /dev/null +++ b/src/test/java/io/github/bonigarcia/wdm/test/chrome/ChromeBetaTest.java @@ -0,0 +1,55 @@ +/* + * (C) Copyright 2020 Boni Garcia (http://bonigarcia.github.io/) + * + * 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 License for the specific language governing permissions and + * limitations under the License. + * + */ +package io.github.bonigarcia.wdm.test.chrome; + +import static org.junit.Assume.assumeTrue; + +import java.io.File; + +import org.junit.Before; +import org.junit.BeforeClass; +import org.openqa.selenium.chrome.ChromeDriver; +import org.openqa.selenium.chrome.ChromeOptions; + +import io.github.bonigarcia.wdm.WebDriverManager; +import io.github.bonigarcia.wdm.test.base.BrowserTestParent; + +/** + * Test with Google Chrome beta version. + * + * @author Boni Garcia (boni.gg@gmail.com) + * @since 4.2.0 + */ +public class ChromeBetaTest extends BrowserTestParent { + + static String chromeBetaPath = "/usr/bin/google-chrome-beta"; + static File chromeBetaFile = new File(chromeBetaPath); + + @BeforeClass + public static void setupClass() { + assumeTrue(chromeBetaFile.exists()); + WebDriverManager.chromedriver().browserPath(chromeBetaPath).setup(); + } + + @Before + public void setupTest() { + ChromeOptions chromeOptions = new ChromeOptions(); + chromeOptions.setBinary(chromeBetaPath); + driver = new ChromeDriver(chromeOptions); + } + +}