问题
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
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).
Please guide what could i do in home.feature file, as i dont have access to change in directory2. Thanks in advance
回答1:
There is a this:
prefix: https://github.com/intuit/karate#reading-files
So this should work when you are inside return.feature
* call read('this:data.feature')
来源:https://stackoverflow.com/questions/64028515/how-to-execute-other-directory-feature-files-in-karate