testFx 已经在 Eclipse 中运行,并且 GUI 测试运行成功。但它不适用于gradle。它给了我一个按钮上的 NoNodeFoundException 。如果我去掉那行代码,它会向我显示指向 TextField 的下一行的相同异常。
除了开发人员之外,似乎没有人尝试将 testfx 与 gradle 结合使用。
知道如何解决吗?
gradle.build
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'checkstyle'
apply plugin: 'application'
apply plugin: 'jacoco'
group = 'TodoManager'
version = '0.0.1'
description = """Aufgabenplanung"""
//隐私保护 mainClassName = "*********.todomanager.model.ReadAndWrite"
defaultTasks 'clean', 'test', 'build', 'jacocoTestReport','distZip','javadoc','wrapper'
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
jcenter()
mavenCentral()
}
jar {
baseName = 'TodoManager'
version = '0.5.0'
}
dependencies {
/*
testCompile group: "org.loadui", name: "testFx", version: "3.1.2"
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit:4.0.+"
compile files('lib/TodoManagerLibrary-1.1.jar')
testCompile 'junit:junit:4.+'
*/
testCompile group: "org.loadui", name: "testFx", version: "3.1.2"
testCompile "junit:junit:4.10"
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-legacy:4.0.+", {
exclude group: "junit", module: "junit"
}
}
checkstyle {
sourceSets = [sourceSets.main]
}
jacoco {
toolVersion = "0.7.1.201405082137"
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "$buildDir/reports/jacoco/html"
}
classDirectories = files('build/classes/')
}
test {
jacoco {
append = false
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpFile = file("$buildDir/jacoco/classpathdumps")
}
}