Skip to content

Commit

Permalink
Include test example using Chrome beta and .browserPath() (issue #548)
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Sep 21, 2020
1 parent ab2b726 commit 7bce900
Showing 1 changed file with 55 additions and 0 deletions.
@@ -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);
}

}

0 comments on commit 7bce900

Please sign in to comment.