【问题标题】:How to execute other directory feature files in karate如何在空手道中执行其他目录功能文件
【发布时间】:2020-09-23 12:58:07
【问题描述】:

我有一种情况,我在 home.feature 工作,需要调用 return.feature 并获取数据。并且内部 return.feature 正在调用 data.feature 并从中收集所有数据。

Source
 directory1
   home.feature
 directory2
   return.feature
   data.feature

我在 home.feature 中写了 * def response = call read('classpath:source/directory2/return.feature')。 在调用此行时,它正在获取正确的功能文件,但在执行 return.feature 时,它​​在调用 data.feature 时抛出错误(javascript 评估失败。java.io.FileNotFoundException)。

请指导我在 home.feature 文件中可以做什么,因为我无权更改目录 2。 提前致谢

【问题讨论】:

    标签: java cucumber karate gherkin


    【解决方案1】:

    有一个this:前缀:https://github.com/intuit/karate#reading-files

    所以当你在return.feature里面时这应该可以工作

    * call read('this:data.feature')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-08
      • 1970-01-01
      相关资源
      最近更新 更多