如何指定目录以从空手道 Github 中的不同 repo 访问 yaml 中的测试资源

How to specify directory to access test resources in yaml from a different repo in Github in Karate

我在 github 的不同回购中的 yaml 中有 API 模式。我想在我的 API 测试

中验证模式

我目前在pom.xml中指定为

<testResource>
          <directory>https://github.com/software/Swagger/blob/main/api/schemas/</directory>
           <includes>
                <include>**/*.yaml</include>
            </includes>
</testResource>

我有两个问题

  1. 为什么我在 target/test-classes 中看不到 yaml 文件?
  2. 有没有办法从 Yaml 测试空手道模式?

空手道不支持这听起来像是一个 Maven 问题,我认为它不受支持。

也就是说,也许您只需要通过 HTTP GET 获取 YAML 文件,您现在应该知道如何使用 Karate 来做到这一点。