Skip to content

Commit 8b242c5

Browse files
committed
Remove dotenv dependency and configure PlaywrightIT to use environment variable for headless mode
1 parent 31fc358 commit 8b242c5

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

.env.dist

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/playwright-java.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
build-and-test:
1111
runs-on: ubuntu-latest
12+
env:
13+
HEADLESS: true
1214

1315
steps:
1416
- name: Checkout

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@
107107
<scope>test</scope>
108108
</dependency>
109109

110-
<dependency>
111-
<groupId>io.github.cdimascio</groupId>
112-
<artifactId>dotenv-java</artifactId>
113-
<version>3.0.0</version>
114-
</dependency>
115-
116110
<dependency>
117111
<groupId>com.microsoft.playwright</groupId>
118112
<artifactId>playwright</artifactId>

src/test/java/org/javadominicano/PlaywrightIT.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.javadominicano;
22

33
import com.microsoft.playwright.*;
4-
import io.github.cdimascio.dotenv.Dotenv;
54
import org.junit.jupiter.api.AfterAll;
65
import org.junit.jupiter.api.AfterEach;
76
import org.junit.jupiter.api.BeforeAll;
@@ -23,10 +22,9 @@ public static void beforeAll() {
2322
playwright = Playwright.create();
2423
BrowserType browserType = playwright.chromium();
2524

26-
Dotenv dotenv = Dotenv.load();
2725

2826
boolean headless = Boolean.parseBoolean(
29-
dotenv.get("HEADLESS", "true")
27+
System.getenv().getOrDefault("HEADLESS", "false")
3028
);
3129

3230
BrowserType.LaunchOptions launchOptions = new BrowserType.LaunchOptions()

0 commit comments

Comments
 (0)