Mat*_*rše 7 junit intellij-idea cucumber cucumber-junit
我正在尝试在IntelliJ中运行黄瓜功能文件。
Cucumber Options指向正确的文件夹,但是在尝试执行JUnit运行器类时收到“无可用任务”通知。
我究竟做错了什么?
这是我的build.gradle:
plugins {
id 'java'
}
sourceCompatibility = 1.8
apply plugin: 'java'
repositories {
mavenCentral()
}
compileJava.options.encoding = "UTF-8"
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.11'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'io.cucumber:cucumber-java:4.7.1'
compile 'org.seleniumhq.selenium:selenium-server:2.44.0'
testImplementation 'io.cucumber:cucumber-java:4.7.1'
compile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
compile group: 'io.cucumber', name: 'cucumber-java', version: '4.7.1'
compile group: 'io.cucumber', name: 'cucumber-junit', version: '4.7.1'
compile group: 'io.cucumber', name: 'cucumber-core', version: '4.7.1'
compile group: 'net.masterthought', name: 'cucumber-reporting', version: '3.20.0'
compile group: 'io.cucumber', name: 'gherkin', version: '5.1.0'
compile group: 'info.cukes', name: 'cucumber-picocontainer', version: '1.2.5'
compile group: 'io.github.bonigarcia', name: 'webdrivermanager', version: '3.6.0'
}
Run Code Online (Sandbox Code Playgroud)
use*_*469 45
当我遇到这个问题(尝试运行测试时出现“无可用任务”消息)时,对我有用的是简单地从 Gradle 视图重新导入项目。
在 Gradle 视图中右键单击项目并选择“重新导入 Gradle 项目”。
“没有可用的任务” – 我在尝试运行 Spock 测试时收到此消息。
原因是我没有正确配置 gradle 插件:
plugins {
id 'java-library'
id 'groovy' // this one is also necessary
}
Run Code Online (Sandbox Code Playgroud)
确保您启用了“groovy”插件,然后重新导入您的项目。
| 归档时间: |
|
| 查看次数: |
708 次 |
| 最近记录: |