2

I see this example

mvn test -Dcucumber.options="--tags ~@ignore" -Dtest=AnimalsTest

How do i pass feature file name directly in command line.

Something like :

mvn test -Dcucumber.options="--features=classpath:com/test/graphql/features/Scenario1.feature" -Dtest=com.graphql.ApiTest;
0

1 Answer 1

3

Since you are using a Java JUnit runner in this case, add a @CucumberOptions annotation to the JUnit class and that is the recommended way to do what you want.

@RunWith(Karate.class)
@CucumberOptions(features = "classpath:com/test/graphql/features/Scenario1.feature")
public class AnimalsTest {
    
}

EDIT - Karate no longer uses annotations for running tests, use the Java Runner API: https://github.com/karatelabs/karate#parallel-execution

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.