I have 2000 repos in my bitbucket which is segregated on 10 projects. Each repo has code which is written in IBM Integration bus/ACE. Means it is not Java application. This will expose a API. We plan to use Karate framework as our continuous testing in Jenkins pipeline.
So I have created one Java project with Runner Java class for POC. This worked!
Public class TestRunner {
@Karate.Test
Karate testFullPath(){
return Karate.run("classpath:mypackage/path/sometest.feature");
//return Karate.run("file:D:\\some\\path\\sometest.feature");
}
}
With the plan of keeping this Karate framework Java project in separate repo. Maintaining all the feature files of 2000 in another separate repo for feature file maintainability.
When I try to pass the feature file from external drive like
return Karate.run("file:D:\\some\\path\\sometest.feature");
it fails with error message saying "java.nio.file.InvalidPathExceptino: IIlegal char <:> at index 4: file:D:\some\path\sometest.feature" ...
Is it possible to call the feature files which is reside outside of Java project ? Please help me on this.
EDIT : I have tried below 2 options to fix the problem.
- I tried to use the Runner by using below snippet. This also returns exacts same error.
@Test
public void testSelected() {
List < String > tags = Arrays.asList("~@skipme");
List < String > features = Arrays.asList("file:D:\\some\\path\\sometest.feature");
String karateOutputPath = "target/surefire-reports";
Results results = Runner.path(features)
.tags(tags)
.outputCucumberJson(true)
.reportDir(karateOutputPath).parallel(5);
DemoTestParallel.generateReport(karateOutputPath);
assertTrue(results.getErrorMessages(), results.getFailCount() == 0);
}
- Explored and found the karate netty standalone jar file. Even when I run the jar file using
java -jar karate-1.2.0.RC2.jar demoAPI.feature
. I am getting error as"Exception in thread main java.lang.NoClassDefFoundError: org/sl4j/LoggerFactory ..."