nicholas
nicholas

Reputation: 2762

How to Run Cucumber 6 CLI

I had coded in cucumber 6 and tried to run in intellij. This code will be run in CI/CD environment as well.

How to run cucumber 6 in CLI?

I tried with the following code but resulted error.

java cucumber.api.cli.Main

Please see error below.

Error: Could not find or load main class cucumber.api.cli.Main
Caused by: java.lang.ClassNotFoundException: cucumber.api.cli.Main

JUnit 4 Runner

java -cp target/ org.junit.runner.JUnitCore com.cimb.TestManager.ParallelRunner

Error

Error: Could not find or load main class org.junit.runner.JUnitCore
Caused by: java.lang.ClassNotFoundException: org.junit.runner.JUnitCore

Upvotes: -1

Views: 222

Answers (1)

Zouf
Zouf

Reputation: 11

Try: java -cp <path to cucumber jar folder> io.cucumber.core.cli.Main -g <glue_path> <feature_path>

Upvotes: 1

Related Questions