Having issue in using @CucumberOptions to run my BDD test cases using Java

24 views
Skip to first unread message

Phani Krishna R

unread,
Sep 17, 2020, 3:16:02 PM9/17/20
to thucydid...@googlegroups.com
Hello team,

I am trying to run my BDD test cases using @CucumberOptions but I am running into any error  "CucumberOptions cannot be resolved to a type"

Here is TestRun code
package salesforce.test;

import net.serenitybdd.cucumber.CucumberWithSerenity;

import org.junit.BeforeClass;
import org.junit.runner.RunWith;

import framework.Environment;
import framework.ExecutionEnvironment;
import framework.Steps;
import framework.TestEnvironment;



@TestEnvironment(Environment.INT2)
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = ".",  plugin = {"pretty", "html:target/cucumber-reports",
        "json:target/cucumber.json",
        "rerun:target/rerun.txt"}, tags = {"@phani"}, glue = {"salesforce.stepdef"})

public class salesforceTest {

@BeforeClass
public static void setEnvironment() {
ExecutionEnvironment.executeClass(salesforceTest.class);
Steps.initialize("testdata.xml");
}
}


Here is my POM.xml file content
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>salesforce</groupId>
<artifactId>UI-testing</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Test Automation</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>2.3.4</serenity.version>
<serenity.cucumber.version>1.9.50</serenity.cucumber.version>
</properties>

<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>${serenity.cucumber.version}</version>
</dependency>
</dependencies>
</project>


Can you please help resolving this issue.

Thanks
Phani

Reply all
Reply to author
Forward
0 new messages