karate - 无法运行空手道测试
问题描述
我无法在我的功能中运行空手道测试
package api;
import com.intuit.karate.junit4.Karate;
import org.junit.runner.RunWith;
@RunWith(Karate.class)
public class PagesRunner {
}
我的功能文件:
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 自动化世界来说非常新。任何帮助深表感谢。
解决方案
我建议您按照快速入门示例开始。
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
没有问题。然后,您可以在此基础上进行构建。
推荐阅读
- amazon-web-services - ECS公有子网服务与私有子网服务通信
- python - ValueError:Python 上的时间数据
- windows - 如何将 Windows IO 完成端口 HANDLE 转换为 GLib 的 GPollFD 以用于自定义 GSource?
- html - 使用 SVG 作为网站特定部分的背景
- python - FileNotFoundError: [WinError 2] 系统找不到指定的文件,但不知道找不到什么文件
- flutter - 构建 Builder(dirty, dependencies: [MediaQuery]): type 'Future
' 不是 'Widget' 类型的子类型 - sql-server - 调用 sysdatetime() 的 UNION 语句的执行顺序是什么?
- javascript - 我的计数器编号动画无法正常工作?
- rush - 让 Rush 将开发依赖项添加到新项目
- asp.net - 构建中排除的文件仍显示在 sonarqube 中