我正在使用空手道 v0.9.6,它是一个很棒的工具。
我有超过 1000 个场景,每个场景都需要令牌才能工作,因此我在 karate-config.js 中使用 callSingle 来创建和缓存令牌。我使用独立的 jar 文件。
我的 karate-config.js 的一部分:
var auth_cfg = {
server: env,
credentials: karate.properties['credentials']};
var result = karate.callSingle('classpath:credentials/generate_tokens.feature', auth_cfg);
我正在使用这样的 .sh 文件:
rm -rf target &&
java -Xmx2048m \
-Dlogback.configurationFile=cfg/logs_debug.xml \
-jar \
-Dcredentials=data.json \
karate-1.0.1.jar -e https://my-server/ \
--tags ~fixme \
--tags ~ignore \
--threads 4 \
features/services/simple_plan.feature
而且,它在 v.0.9.6 上运行很长时间都完美。
但是,当我尝试升级到 v 1.0 或 1.0.1 时,出现错误:
org.graalvm.polyglot.PolyglotException: not found: credentials/generate_tokens.feature
我发现这个问题:https://github.com/intuit/karate/issues/1515
但例子对我不起作用。我正在尝试使用“file:”和 karate.properties['karate.config.dir'] + '/features/auth/auth.feature'。
我总是收到错误:
未找到:credentials/generate_tokens.feature
还有谁遇到过这个问题?