Skip to content

Commit 647fab4

Browse files
committed
Fix browser binary test
1 parent ec61816 commit 647fab4

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/test/java/io/github/bonigarcia/wdm/test/chrome/ChromeBinaryTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
import java.io.File;
2424

2525
import org.junit.jupiter.api.AfterEach;
26-
import org.junit.jupiter.api.BeforeAll;
2726
import org.junit.jupiter.api.BeforeEach;
2827
import org.junit.jupiter.api.Test;
2928
import org.openqa.selenium.WebDriver;
30-
import org.openqa.selenium.chrome.ChromeDriver;
29+
import org.openqa.selenium.chrome.ChromeOptions;
3130

3231
import io.github.bonigarcia.wdm.WebDriverManager;
3332

@@ -38,15 +37,13 @@ class ChromeBinaryTest {
3837

3938
WebDriver driver;
4039

41-
@BeforeAll
42-
static void setupClass() {
43-
assumeThat(chromeBetaFile).exists();
44-
WebDriverManager.chromedriver().browserBinary(chromeBetaBinary).setup();
45-
}
46-
4740
@BeforeEach
4841
void setupTest() {
49-
driver = new ChromeDriver();
42+
assumeThat(chromeBetaFile).exists();
43+
ChromeOptions options = new ChromeOptions();
44+
options.setBinary(chromeBetaFile);
45+
driver = WebDriverManager.chromedriver().capabilities(options)
46+
.browserBinary(chromeBetaBinary).create();
5047
}
5148

5249
@AfterEach

0 commit comments

Comments
 (0)