Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 {
}
like image 387
yeniden Avatar asked Nov 10 '22 22:11

yeniden


1 Answers

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)
like image 67
Jim Barton Avatar answered Nov 14 '22 22:11

Jim Barton