Closed Tech-D closed 7 years ago
I can't see any attached files? The simplest way to create a sample project is to use the maven archetypes.
There is no issue with dependencies. I can see them downloaded successfully. The issue for me in the statement @RunWith(CucumberWithSerenity.class). import net.serenitybdd.cucumber.CucumberWithSerenity has been included as well.
Code:
import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; import org.junit.runner.RunWith;
@RunWith(CucumberWithSerenity.class) @CucumberOptions(features="src/test/resources/features") public class AcceptanceTests { }
POM extract: recent versions are added for below
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>${serenity.cucumber.version}</version>
</dependency>
Apparently, there was some issue with cucumber.api.junit and cucumber.api.java jars that were downloaded. I had to delete and freshly download all jars to make it work.
Thanks for the support!
Thanks for the update :-)
While defining CucumberWithSerenity test runner I get below error basically saying incompatible type. Has anyone encountered this issue? Incompatible types- Found: CucumberWithSerenity.class, expected: org.junit.runner.Runner
I am creating a simple serenity cucumber BDD automation test using maven on google website just to see how serenity works. Please advise if I am missing anything here.
ATTACHED - pom.xml and error screenshot