我能够在Eclipse中运行gradle项目并查看生成的测试输出。但是,当我在命令上执行此操作时,测试报告中未显示任何内容。
我尝试了$ gradlew构建,然后尝试了$ gradlew干净测试。
apply plugin: 'eclipse'
apply plugin: 'java-library'
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:27.0.1-jre'
compile 'org.seleniumhq.selenium:selenium-java:3.13.0'
compile 'com.relevantcodes:extentreports:2.41.2'
compile 'org.testng:testng:6.14.3'
}
test {
useTestNG(){
useDefaultListeners = true
suites "testng.xml"
}
}