我有这个build.gradle文件

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.serenity-bdd.aggregator'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
}

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath("net.serenity-bdd:serenity-gradle-plugin:1.4.0")
    }
}

dependencies {
    testCompile('net.serenity-bdd:serenity-core:1.4.0')
    testCompile('net.serenity-bdd:serenity-junit:1.4.0')
    testCompile('junit:junit:4.12')
    testCompile('org.assertj:assertj-core:1.7.0')
    testCompile('org.slf4j:slf4j-simple:1.7.7')

}

gradle.startParameter.continueOnFailure = true

它将 Restful 库加载到项目中,但编译时某些类不可见:
PageObject class is not visible

但它确实存在于外部库中:

Class in the libs

我应该怎么做才能使其在测试类和页面对象类中可见?
另外,当我通过输入库的完整路径手动导入时,gradleRunner仍然看不到那些类。

最佳答案

问题已解决。选择了错误的编译范围。需要被编译而不是testCompile。

10-02 11:22