首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TestFX和Gradle - NoNodeFoundException

TestFX和Gradle - NoNodeFoundException
EN

Stack Overflow用户
提问于 2016-01-17 05:30:15
回答 1查看 451关注 0票数 0

testFx已经可以在Eclipse中运行,并且图形用户界面测试已经成功运行。但它不适用于gradle。它给了我一个按钮上的NoNodeFoundException。如果我去掉那一行代码,它会向我展示指向TextField的下一行的异常。

似乎除了开发人员之外,没有人尝试过将testfx与gradle结合使用。

你知道怎么解决这个问题吗?

gradle.build

代码语言:javascript
复制
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“

代码语言:javascript
复制
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")
    }
}

不知道这是否有帮助,但这是我的项目结构。

EN

回答 1

Stack Overflow用户

发布于 2016-04-19 23:46:43

我最近开始在gradle中使用testfx。

这是我的build.gradle

代码语言:javascript
复制
plugins{
    id 'application'
    id 'com.github.johnrengelman.shadow' version '1.2.3'
}

mainClassName = "dialogio.Dialogio"
repositories {
    mavenCentral()
}
dependencies{
    compile 'com.google.guava:guava:19.0'
    compile 'org.controlsfx:controlsfx:8.40.10'
    testCompile 'org.loadui:testFx:3.1.0'
}
test {
  testLogging.showStandardStreams = true
}

只有在我设置了CSS id之后,它才能工作:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34832352

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档