Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cucumber-java and cucumber-junit after version 1.0.14 does not work

I am using Cucumber-JVM and Selenium WebDriver together. I have a Maven project in eclipse and dependency of pom.xml file is as below:

<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>1.2.2</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>1.2.2</version>
    <scope>test</scope>
</dependency>

The content of RunCukesTest.java file is:

import org.junit.runner.RunWith;
import cucumber.junit.Cucumber;
@RunWith(Cucumber.class)
@Cucumber.Options(format = {"pretty", "html:target/cucumber-htmlreport","json-pretty:target/cucumber-report.json"})
public class RunCukesTest {
}

I am getting the error in the following lines of code:

import cucumber.junit.Cucumber;
@RunWith(Cucumber.class)
@Cucumber.Options(format = {"pretty", "html:target/cucumber-htmlreport","json-pretty:target/cucumber-report.json"})

But when I used the version 1.0.14 it works well. What's the wrong with the latest version?

like image 254
Ripon Al Wasim Avatar asked Jul 08 '15 07:07

Ripon Al Wasim


1 Answers

@Cucumber.Options is deprecated use @CucumberOptions instead

@CucumberOptions(
    format = "pretty",
    features = "//refer to Feature file"  
)

Hope this helps you

like image 116
Vicky Avatar answered Oct 05 '22 15:10

Vicky