You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running in IDE, it's working fine: the .feature file is a real file on disk, in a folder, and Karate succeed to find its sibling time-validator.js file.
But when packing the project in a JAR and running Karate in the JAR, the .feature file cannot find its sibling resource.
Karate should know that the .feature file has been read from the classpath (in the JAR), then reconstruct the full path of the sibling resource to request it to Java's getResource().
NOTE: "../" should also work. In fact, the example above is a simplified version of my problem: I have this tree structure:
features/*.feature : the files to run in Karate
feature-libs/*.feature : the files to include in other business .feature files
scripts/*.js : this is where to load/import/require java-scripts
=> so my need is to make read('../scripts/time-validator.js') work from any .feature file, in IDE or in a JAR.
(NOT talking about the UI: just the runtime)
Yes, read('classpath:scripts/time-validator.js') works both in IDE and in a JAR. BUT, in the future, I'd like the .feature files to be sometimes in the classpath, sometimes externalised to another folder on disk, so I need relative paths to work without any "classpath:" prefixes nor hard-coded full paths.
The text was updated successfully, but these errors were encountered:
for me this is low priority. all the projects I know are happy with classpath: for re-use via JARs. tagging as "help wanted" and will close if inactive. sounds very much like YAGNI to me.
I have a .feature file that has this line:
When running in IDE, it's working fine: the .feature file is a real file on disk, in a folder, and Karate succeed to find its sibling time-validator.js file.
But when packing the project in a JAR and running Karate in the JAR, the .feature file cannot find its sibling resource.
Karate should know that the .feature file has been read from the classpath (in the JAR), then reconstruct the full path of the sibling resource to request it to Java's getResource().
NOTE: "../" should also work. In fact, the example above is a simplified version of my problem: I have this tree structure:
=> so my need is to make read('../scripts/time-validator.js') work from any .feature file, in IDE or in a JAR.
(NOT talking about the UI: just the runtime)
Yes, read('classpath:scripts/time-validator.js') works both in IDE and in a JAR.
BUT, in the future, I'd like the .feature files to be sometimes in the classpath, sometimes externalised to another folder on disk, so I need relative paths to work without any "classpath:" prefixes nor hard-coded full paths.
The text was updated successfully, but these errors were encountered: