Skip to content

Commit 6f59c05

Browse files
committed
added chromeoptions to run tests in headless mode
1 parent 3fdebc7 commit 6f59c05

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/java/io/github/mfaisalkhatri/test/BaseTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import org.openqa.selenium.WebDriver;
66
import org.openqa.selenium.chrome.ChromeDriver;
7+
import org.openqa.selenium.chrome.ChromeOptions;
78
import org.testng.annotations.AfterClass;
89
import org.testng.annotations.BeforeClass;
910

@@ -13,6 +14,11 @@ public class BaseTest {
1314

1415
@BeforeClass
1516
public void setup () {
17+
ChromeOptions chromeOptions = new ChromeOptions ();
18+
chromeOptions.addArguments ("--headless=new");
19+
chromeOptions.addArguments ("disable-gpu");
20+
chromeOptions.addArguments("--disable-dev-shm-usage");
21+
1622
this.driver = new ChromeDriver ();
1723
this.driver.manage ()
1824
.window ()

0 commit comments

Comments
 (0)