0
how can we trigger cucumber java runner file from cmd line?

Open 1 Answers 12 Views

I have written a automated test sute using Java Cucumber. Can you tell me how can we trigger cucumber java runner file from cmd line? I am neither using maven nor ant?

I can use JUnit runner.

1 Answer

0

You can run the test the same way you would run a JUnit test on the command line:

java -cp <classpath> org.junit.runner.JUnitCore com.example.test.RunCukesTest

where RunCukesTest is the unit test that sets all the cucumber options, e.g.:

package com.example.test;

import org.junit.runner.RunWith;

import cucumber.api.junit.Cucumber;
import cucumber.api.CucumberOptions;

@RunWith(Cucumber.class)
@CucumberOptions(plugin = "json:target/report.json")
public class RunCukesTest {
}

<classpath> is where you can mention your JAR files.

If all your JAR files are inside lib folder, your command can be:

java -cp "lib/*" org.junit.runner.JUnitCore com.example.test.RunCukesTest


 

answered Jul 18 by anonymous
...