Skip to content

Commit f02d15a

Browse files
committed
Runs UI tests on CI Servers Headless with Monocle
Trying to run the tests with xvfb was causing tests to fail. This should resolve this problem.
1 parent 69fd426 commit f02d15a

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install:
2626
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew :ui:assemble --stacktrace || ./gradlew --stacktrace '
2727

2828
script:
29-
- ./gradlew check --stacktrace -PprintTestResults
29+
- ./gradlew check --stacktrace -Pheadless=true
3030

3131
after_success:
3232
- codecov

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ install:
22
- choco install -y InnoSetup
33

44
build_script:
5-
- gradlew.bat :ui:assemble --stacktrace -PprintTestResults
5+
- gradlew.bat :ui:assemble --stacktrace
66

77
# to run your custom scripts instead of automatic tests
88
test_script:
9-
- gradlew.bat check --stacktrace -PprintTestResults
9+
- gradlew.bat check --stacktrace -Pheadless=true
1010

1111
platform:
1212
- x64

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ project(":ui") {
290290
testCompile files(project(':core').sourceSets.test.output.resourcesDir)
291291
testCompile group: 'org.testfx', name: 'testfx-core', version: '4.0.+'
292292
testCompile group: 'org.testfx', name: 'testfx-junit', version: '4.0.+'
293+
testRuntime group: 'org.testfx', name: 'openjfx-monocle', version: '1.8.0_20'
293294
}
294295

295296
evaluationDependsOn(':core')
@@ -299,6 +300,17 @@ project(":ui") {
299300
scopes.PROVIDED.plus += [configurations.ideProvider]
300301
}
301302

303+
/*
304+
* Allows you to run the UI tests in headless mode by calling gradle with the -Pheadless=true argument
305+
*/
306+
if (project.hasProperty('headless') && project.headless) {
307+
println "Running UI Tests Headless"
308+
test {
309+
jvmArgs = ['-Djava.awt.headless=true', '-Dtestfx.robot=glass', '-Dtestfx.headless=true', '-Dprism.order=sw', '-Dprism.text=t2k']
310+
}
311+
}
312+
313+
302314
javafx {
303315
profiles {
304316
linux {

0 commit comments

Comments
 (0)