Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run feature file outside of classpath #1981

Closed
visasimbu opened this issue Apr 17, 2022 · 3 comments
Closed

Run feature file outside of classpath #1981

visasimbu opened this issue Apr 17, 2022 · 3 comments
Labels

Comments

@visasimbu
Copy link

visasimbu commented Apr 17, 2022

Background :
I am trying to setup continous integration using Jenkins with the help of Karate framework. I got stuck in the setup. Need help on this.

I have 2000 feature files for each repo/API to perform testing. Feature file list can grow as day passes. Each feature file and its test data was organized in bitbucket repos. Hence I have planned to created a generic maven project along with karate which accepts feature file name as a parameter in CLI to perform testing and create report.

So I have created a project with karate-core in my pom file which is bundled with all its dependencies.

Code https://github.com/visasimbu/ContinousIntegration

Steps to reproduce

  1. run mvn clean install
  2. You will see the "java.lang.IllegalArgumentException"

Expected result
I want to execute the my jar file as like below via command prompt. Please route it to me if you have any samples.
java -jar target/sample-test-jar-with-dependencies.jar.jar NewdemoAPI.feature

Issue
This is the snippet of my main class

Results results = Runner.path("file:E:\\Simbu\\POC\\features\\NewdemoAPI.feature")
//        Results results = Runner.path("classpath:features")
                .tags("@Integration")
                .parallel(2);

If I remove the uncomment the line #2 and commet line #1 it works as expected. How can I run the feature file which is kept other than classpath ?

@visasimbu visasimbu changed the title Run feature file other classpath Run feature file other than classpath Apr 17, 2022
@visasimbu visasimbu changed the title Run feature file other than classpath Run feature file outside of classpath Apr 17, 2022
@ptrthomas
Copy link
Member

@visasimbu I'm sorry this is not "in scope" for karate as we have said in response to many similar questions. we only support feature files in the current java project or classpath and that's it.

examples: #427 #520 #529

I think your best bet is to go through the above threads, do some research, find someone to help you if needed and eventually contribute code to the karate project if needed. all the best !

@visasimbu
Copy link
Author

@ptrthomas Came here to say thanks for this wonderful tool !!! Also the given links helped me to resolve my issue. I thought the input or question posting is not sufficient to answer/help by you. Hence I was trying to provide more information each time. Finally I am able to resolve my issue.

Thanks once again for your quick reply and links !!!

@supreetrai
Copy link

@visasimbu - We are also struggling with same issue. Could you please share your solution / workaround here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants