Search code examples
javagradlebddlibrariesthucydides

Gradle loaded Serenity libs to project libraries but can't see them further


I have this build.gradle file

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

It loads serenity libraries to the project BUT some classes are not visible when compile: PageObject class is not visible

but it truly exists in External libs:

Class in the libs

What should I do to make it be visible in test classes and page object classes? Also when I import manually by entering full path to the library then gradle runner does not see those classes anyway.


Solution

  • Issue is resolved. Wrong compile scope was chosen. Need to be compile not testCompile.