How to run @RunWith(Cucumber.class) step by step

17,005

Cucumber will default to looking for feature files under the same package as RunCucksTest. You can also change the location(s) it will look for feature files by supplying the "features" option with the @CucumberOptions annotation (in RunCucksTest). E. g.,

@CucumberOptions(strict = true,  features = {
        "src/test/resources/cucumber/",
    },monochrome=true)
Share:
17,005

Related videos on Youtube

yeniden
Author by

yeniden

Updated on July 02, 2022

Comments

  • yeniden
    yeniden almost 2 years

    I'm working on a BDD file and trying to test with JUnit.

    I want to use RunCukesTest class with @RunWith(Cucumber.class).

    I've searched on many websites about how to install requirements, but I couldn't find any website which explains it briefly, step by step.

    Could you explain me briefly, step by step, how can I run my test?

    package test.newtest;
    
    import cucumber.junit.Cucumber;
    import org.junit.runner.RunWith;
    
    @RunWith(Cucumber.class)
    public class RunCukesTest {
    }