通过Maven通过命令行将其他参数传递给karate-config.js [英] Pass additional parameters to karate-config.js via command line via Maven
问题描述
通过Maven运行时,我需要将其他设置传递给空手道,这些设置将在karate-config.js中提供.目前,我可以使用karate.env属性传递一个字符串-是否有必要将我的参数编码为JSON对象并通过此一个属性传递它们,或者我可以执行以下操作:
I have additional settings that I need to pass to Karate when running via Maven that will be available in karate-config.js. Currently I can pass in a string using the karate.env property - is it necessary to encode my parameters as a JSON object and pass them in via this one property or can I do something like:
mvn test -DargLine="-Dkarate.env='production' -Dkarate.clientid='1234567890' ...
然后我可以在karate-config.js中引用karate.clientid,将其保存到返回的配置对象中.
Such that I can then reference karate.clientid in karate-config.js where I can save it into the returned config object.
我确定我在这里遗漏了一些明显的东西...
I'm sure I'm missing something obvious here...
推荐答案
是!有关karate.properties['karate.clientid']
,请参见文档.
Here is an example karate-config.js
这篇关于通过Maven通过命令行将其他参数传递给karate-config.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!