0

I am having a runner class which has the tags which i need to run. The same is working perfectly as it picks the features that needs to be executed

the runner class looks like

package test.java.cucumber.policy;

    import com.github.mkolisnyk.cucumber.runner.ExtendedCucumber;
    import com.github.mkolisnyk.cucumber.runner.ExtendedCucumberOptions;
    import cucumber.api.CucumberOptions;
    import cucumber.runtime.ClassFinder;
    import cucumber.runtime.RuntimeOptions;
    import cucumber.runtime.io.MultiLoader;
    import cucumber.runtime.io.ResourceLoader;
    import cucumber.runtime.io.ResourceLoaderClassFinder;
    import gherkin.Main;
    import org.junit.runner.RunWith;

    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;

    @RunWith(ExtendedCucumber.class)


    @ExtendedCucumberOptions(
                    retryCount = 0)

    @CucumberOptions(glue = {"test.java.steps"},
                    features = {"src/test/resources/features/policy/shakedown"},
                  tags = {"@test"}

    )
    public class ShakedownRunner {



    }

When i try to run the same from command prompt, i am getting the step definitions not found error message.

I am using the following command to execute from command prompt

java -cp "extlib/*;." cucumber.api.cli.Main -p pretty -g C:\21stNov\src\test\java\steps\common\BrowserSteps.java C:\21stNov\src\test\resources\features\policy\shakedown\test.feature

On executing i am getting that the step definitions are missing. Can somebody look into this and provide his valuable comments

#Shakedown Test 1
  @Shakedown @Shakedown1 @rajat
  Scenario: SHD_001_1-Portal SE Quote to GW and check quote documents ←[90m# C:/21stNov/src/test/resources/features/policy/shakedown/test.feature:6←[0m
    ←[33mGiven ←[0m←[33mI start the web browser←[0m

1 Scenarios (←[33m1 undefined←[0m)
1 Steps (←[33m1 undefined←[0m)
0m0.000s


You can implement missing steps with the snippets below:

@Given("^I start the web browser$")
public void i_start_the_web_browser() throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

Thanks in Advance..!

mate00
  • 2,727
  • 5
  • 26
  • 34

1 Answers1

0

This question possibly duplicate of this one : How to run cucumber file from command line

According to answers, you can run it with cucumber-jvm on command line as below :

java -cp <classpath> cucumber.api.cli.Main \
   --glue com.example.test \
   --plugin pretty path/to/features
sayhan
  • 1,168
  • 1
  • 16
  • 22
  • Hi I have tried the similar approach but, still getting issues if you have a look at my question i have posted the same command but getting step definitions not found error – Rajat Kachhal Feb 18 '19 at 22:40
  • Wolsu you add “Test” to end of your runner name. ShakedoenRunnerTest – sayhan Feb 19 '19 at 05:58