黄瓜与依赖步骤

时间:2017-07-21 21:31:24

标签: gradle dependency-injection cucumber

我试图在项目中使用gradle执行黄瓜测试(" ACTUAL_PROJECT"),但它依赖于其他项目(" DEPENDENCY")。 " ACTUAL_PROJECT"的测试使用" DEPENDENCY"。

的一些核心功能和步骤

问题在于执行检测未定义的步骤(来自依赖项)并跳过实际项目中的步骤。

17 Steps (5 skipped, 12 undefined)
You can implement missing steps with the snippets below:

的build.gradle

project(':ACTUAL_PROJECT') {
    dependencies {
        testCompile project(':DEPENDENCY').sourceSets.test.output
    }

    configurations {
        cucumberRuntime.extendsFrom testRuntime
        testCompile.transitive = false
    }

    task integrationTest(dependsOn: [testClasses, compileTestJava]) {
        doLast {
            return javaexec {
                main = "cucumber.api.cli.Main"
                classpath = configurations.cucumberRuntime + sourceSets.test.output
                args = ["-g",
                    "xx.xxx.xxxx.ACTUAL_PROJECT.steps",
                    "classpath: xx.xxx.xxxx.DEPENDENCY.steps",
                    "src/test/resources/features/ ",
                    "-p",
                    "pretty"]
        }
    }
}

由于

0 个答案:

没有答案