Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Karate 如何对带参数的条件功能调用使用eval?_Karate - Fatal编程技术网

Karate 如何对带参数的条件功能调用使用eval?

Karate 如何对带参数的条件功能调用使用eval?,karate,Karate,我想用参数调用功能文件中的另一个功能文件,但前提是前一个api响应的数据值为真。在运行这个eval函数之后,我想让它继续运行我的主要功能的其他部分。我写了这段代码 eval if(response.data.eula==true)karate.call('classpath:eula/eula sign.feature'){no:'#(no)”,password:#(password)} 但我不能这样使用eval。我怎样才能达到我上面解释的目标 我尝试过条件逻辑方法,这在空手道直觉页面中有解

我想用参数调用功能文件中的另一个功能文件,但前提是前一个api响应的数据值为真。在运行这个eval函数之后,我想让它继续运行我的主要功能的其他部分。我写了这段代码

  • eval if(response.data.eula==true)karate.call('classpath:eula/eula sign.feature'){no:'#(no)”,password:#(password)}
但我不能这样使用eval。我怎样才能达到我上面解释的目标

我尝试过条件逻辑方法,这在空手道直觉页面中有解释。但我无法解决我的问题

  • eval if(response.data.eula==true)karate.call('classpath:eula/eula sign.feature'){no:'#(no)”,password:#(password)}
正如我预料的那样,空手道给了我这些日志; com.intuit.karate.exception.KarateException:content filter.feature:26-javascript评估失败:if(response.data.eula==true);karate.call('classpath:eulasign/eula sign.feature'){no:'#(no)”,密码:'#(password)},应为1:135;但是发现{ if(response.data.eula==true);karate.call('classpath:eulasign/eula sign.feature'){no:'#(no)”,密码:'#(password)}
^在第1行第135列中,您正在混合
空手道。call
call read
。 它要么是
karate.call(文件名,[arg])
要么是
call read(文件名){arg}

因此,对于karate.call,变量
no
password
必须以JSON格式作为函数的第二个参数传递