Skip to content

Commit

Permalink
Use WebDriverManager API and Selenium-Jupiter Docker annotation to se…
Browse files Browse the repository at this point in the history
…t arguments
  • Loading branch information
bonigarcia committed Dec 29, 2023
1 parent fd8c569 commit 75c27fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ public class DockerChromeBetaJUnit4Test {
@Before
public void setupTest() {
assumeThat(isDockerAvailable()).isTrue();
System.setProperty("wdm.dockerDefaultArgs",
"--disable-gpu,--no-sandbox");
driver = wdm.create();
driver = wdm.dockerDefaultArgs("--disable-gpu,--no-sandbox").create();
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@
@ExtendWith(SeleniumJupiter.class)
class DockerChromeBetaSelJupTest {

{
System.setProperty("wdm.dockerDefaultArgs",
"--disable-gpu,--no-sandbox");
}

@Test
void testDockerChromeBeta(
@DockerBrowser(type = CHROME, version = "beta") WebDriver driver) {
@DockerBrowser(type = CHROME, version = "beta", args = "--disable-gpu,--no-sandbox") WebDriver driver) {
driver.get("https://bonigarcia.dev/selenium-webdriver-java/");
assertThat(driver.getTitle()).contains("Selenium WebDriver");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ class DockerChromeBetaJupiterTest {
@BeforeEach
void setupTest() {
assumeThat(isDockerAvailable()).isTrue();
System.setProperty("wdm.dockerDefaultArgs",
"--disable-gpu,--no-sandbox");
driver = wdm.create();
driver = wdm.dockerDefaultArgs("--disable-gpu,--no-sandbox").create();
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ public class DockerChromeBetaNGTest {
@BeforeMethod
public void setupTest() {
assumeThat(isDockerAvailable()).isTrue();
System.setProperty("wdm.dockerDefaultArgs",
"--disable-gpu,--no-sandbox");
driver = wdm.create();
driver = wdm.dockerDefaultArgs("--disable-gpu,--no-sandbox").create();
}

@AfterMethod
Expand Down

0 comments on commit 75c27fb

Please sign in to comment.