如何在空手道中执行其他目录特征文件

How to execute other directory feature files in karate

我有一种情况,我在 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 文件中可以做什么,因为我无权更改 directory2。 提前致谢

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

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

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