Skip to content

Commit cde68c0

Browse files
committed
Add system property to start tests fullscreen in ci.
1 parent ca1bd4b commit cde68c0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dependencies {
6161

6262
javafx {
6363
version = '14'
64+
// javafx.swing necessary for screenshot capturing in tests
6465
modules = ['javafx.controls', 'javafx.swing']
6566
}
6667

@@ -80,7 +81,7 @@ test {
8081
ci {
8182
githubactions {
8283
test {
83-
jvmArgs.remove('-Dprim.forceGPU=true')
84+
systemProperty "fullScreenTests", true
8485
}
8586
}
8687
}

src/test/java/boundingboxeditor/BoundingBoxEditorTestBase.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class BoundingBoxEditorTestBase {
5454
private static final String STYLESHEET_PATH = "/stylesheets/css/styles.css";
5555
private static final Path SCREENSHOT_PATH = Paths.get("").toAbsolutePath().resolve(
5656
"build/test-screenshots/");
57+
private static final String FULL_SCREEN_TESTS_SYSTEM_PROPERTY_NAME = "fullScreenTests";
5758
protected static int TIMEOUT_DURATION_IN_SEC = 30;
5859
protected static String TEST_IMAGE_FOLDER_PATH_1 = "/testimages/1";
5960
protected static String TEST_IMAGE_FOLDER_PATH_2 = "/testimages/2";
@@ -169,6 +170,10 @@ protected void onStart(Stage stage) {
169170
// To make sure that the window is on top of all other windows at the start.
170171
stage.setAlwaysOnTop(true);
171172

173+
if(Boolean.getBoolean(FULL_SCREEN_TESTS_SYSTEM_PROPERTY_NAME)) {
174+
stage.setMaximized(true);
175+
}
176+
172177
final Scene scene = createSceneFromParent(mainView);
173178
scene.getStylesheets().add(getClass().getResource(STYLESHEET_PATH).toExternalForm());
174179

0 commit comments

Comments
 (0)