lundi 5 avril 2021

karate.callSingle not found .feature file in karate-config.js

I'm using karate v0.9.6, and it's wonderful tool. I have a >1000 scenarios, each of them need to token for work, so i use callSingle in karate-config.js for creating and caching tokens. I use standalone jar file.

Part of my karate-config.js:

  var auth_cfg = { 
  server: env,
  credentials: karate.properties['credentials']};

  var result = karate.callSingle('classpath:credentials/generate_tokens.feature', auth_cfg);

I'm using .sh file like this:

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

And, it's working perfectly on v.0.9.6 long time. But, when I'm try to upgrade to v 1.0 or 1.0.1, a give an error:

org.graalvm.polyglot.PolyglotException: not found: credentials/generate_tokens.feature

I found this issue: https://github.com/intuit/karate/issues/1515

But examples not working for me. I'm trying use "file:" and karate.properties['karate.config.dir'] + '/features/auth/auth.feature'. Always i got an error:

not found: credentials/generate_tokens.feature

Who else has faced this problem?

Aucun commentaire:

Enregistrer un commentaire