【问题标题】:Unable to Run Karate Tests无法运行空手道测试
【发布时间】:2018-09-04 13:36:52
【问题描述】:

我无法在我的功能中运行空手道测试

package api;
import com.intuit.karate.junit4.Karate;
import org.junit.runner.RunWith;
@RunWith(Karate.class)
public class PagesRunner {
}

this is the report which gets generated

我的功能文件:

Feature: some Adaptor Request Success

Background:
* def myUrl = baseURL
* configure headers = read('classpath:some-headers.js')
Scenario: Some Adaptor Success
* def someInitiate= read('classpath:requests/someRequest.json')
* url myUrl
Given path 'api/somerequest'
And request someInitiate
When method post
Then status 202

不确定我在这里缺少什么。对 api 自动化世界来说非常新。非常感谢任何帮助。

【问题讨论】:

  • 当我直接运行功能文件时,我得到这个错误:1 Scenarios (1 undefined) 8 Steps (8 undefined)

标签: karate


【解决方案1】:

我建议您按照快速入门示例开始。

https://github.com/intuit/karate#quickstart

mvn archetype:generate \
-DarchetypeGroupId=com.intuit.karate \
-DarchetypeArtifactId=karate-archetype \
-DarchetypeVersion=0.8.0 \
-DgroupId=com.mycompany \
-DartifactId=myproject

然后尝试运行UsersRunner.java | users.feature 没有问题。然后,您可以在此基础上进行构建。

【讨论】:

  • 嗨@Peter,感谢您的回复。我使用 gradle 作为我的构建工具。这就是我的 gradle 构建文件中的内容。不知道我在这里缺少什么.. `testCompile 'com.intuit.karate:karate-apache:0.8.0' testCompile 'com.intuit.karate:karate-junit4:0.8.0' testCompile 'com.intuit.karate:空手道核心:0.8.0'
  • @Madhusudhan 抱歉,我无法在 Gradle 方面为您提供帮助。看看这是否对您有帮助:github.com/intuit/karate/issues/463#issuecomment-406599694
猜你喜欢
  • 1970-01-01
  • 2021-03-15
  • 1970-01-01
  • 1970-01-01
  • 2020-06-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多