如何在空手道中执行其他目录功能文件 [英] How to execute other directory feature files in karate
问题描述
我遇到一种情况,我在home.feature中工作,需要调用return.feature并获取数据.内部return.feature调用data.feature并从中收集所有数据.
I had a situation where i am working in home.feature and need to call return.feature and gets the data. And internally return.feature is calling data.feature and collects all the data from it.
Source
directory1
home.feature
directory2
return.feature
data.feature
我写了* def response =在home.feature中调用read('classpath:source/directory2/return.feature'). 在调用此行时,它正在拾取正确的功能文件,但是在执行return.feature时,在调用data.feature时抛出错误(javascript评估失败.java.io.FileNotFoundException).
I have written * def response = call read('classpath:source/directory2/return.feature') in home.feature. while calling this line, it is picking up the correct feature file, but while executing return.feature, it throws error while calling data.feature(javascript evaluation failed. java.io.FileNotFoundException).
请指导我在home.feature文件中可以做什么,因为我无权更改directory2. 预先感谢
Please guide what could i do in home.feature file, as i dont have access to change in directory2. Thanks in advance
推荐答案
有一个this:
前缀:因此,当您位于return.feature
* call read('this:data.feature')
这篇关于如何在空手道中执行其他目录功能文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!