Closed UtsaChakraborty closed 6 years ago
That would be an IDE issue - make sure you have imported the project as a Maven or Gradle project.
Hi , Thank you for your reply, I am using ecilpse oxygen IDE and imported the project as an existing Maven Project. Took the help of the POM in Github. PFB the POM am using: <?xml version="1.0" encoding="UTF-8"?> <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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>net.serenitybdd.starter</groupId>
<artifactId>starter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Sample Serenity BDD project using Cucumber</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>1.9.12</serenity.version>
<serenity.maven.version>1.9.12</serenity.maven.version>
<serenity.cucumber.version>1.9.5</serenity.cucumber.version>
<encoding>UTF-8</encoding>
<tags></tags>
<parallel.tests>4</parallel.tests>
<webdriver.base.url></webdriver.base.url>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-jbehave-archetype</artifactId>
<version>1.8.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit-archetype</artifactId>
<version>1.8.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-screenplay</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-screenplay-webdriver</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>${serenity.cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/Test*.java</include>
<include>**/*TestSuite.java</include>
<include>**/When*.java</include>
</includes>
<systemPropertyVariables>
<webdriver.base.url>${webdriver.base.url}</webdriver.base.url>
</systemPropertyVariables>
<parallel>classes</parallel>
<threadCount>${parallel.tests}</threadCount>
<forkCount>${parallel.tests}</forkCount>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.maven.version}</version>
<configuration>
<tags>${tags}</tags>
</configuration>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Please let me know how to solve this issue with net.serenitybdd.cucumber.CucumberWithSerenity package
Can you run it from the command line?
like validate or compile? because while validating I am getting compilation error for the runner class: package runners; import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; //@RunWith(SerenityRunner.class) @RunWith(CucumberWithSerenity.class) @CucumberOptions(features="src/test/resources/features") public class TestRunner {
}
mvn verify
The error is gone...thank you so much :)
Sometimes IntelliJ doesn't download all the maven dependencies and you need to run mvn verify from the command line; maybe Eclipse is the same.
seems so
Sometimes IntelliJ doesn't download all the maven dependencies and you need to run mvn verify from the command line; maybe Eclipse is the same.
Hi @wakaleo , i would like to know how to run mvn verify from the command line in IntelliJ on Windows? Is it will be same with just click the Verify lifecycle in Maven Project Toolbar here? Thank you very much for your kindness
The error is gone...thank you so much :)
Hi @UtsaChakraborty it is really gone because of you are running mvn verify in command line ? Thankyou very much. I'm also having a problem in making jbehave test running in parallel, and im trying to add SerenityRunner.class to my code just like the docs in http://thucydides.info/docs/serenity-staging/#_configuration_parallel_executing_with_jenkins Thank you, have a good day
Yes, that will work
Hi @wakaleo , thank you for your help. I would like to know does running serenity test in parallel batches (as in the docs here http://thucydides.info/docs/serenity-staging/#_running_serenity_tests_in_parallel_batches ) still working with the serenity-jbehave-archetype version here? Thank you very much for your kindness
Hi, I try to run my serenity project but SerenityRunner class gives me error. I tried mvn verify through terminal than I got compilation error cannot find symbol: class SerenityRunner error.
I hope someone could help me soon? Thank you
Add this block of dependency to pom.xml file, then click on a little blue icon(m) on the right top corner to update the maven dependencies
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
it fixed it for me, hope it works for you too!!
Hello, I cloned the repository: https://github.com/serenity-bdd/serenity-junit-starter and the Intellij doesn't find the class Ensure (import net.serenitybdd.screenplay.ensure.Ensure; ), in pom.xml I added the dependency:
<artifactId>serenity-ensure</artifactId>
<version>${serenity.version}</version>
<scope>test</scope>
</dependency>
How can be solved this issue? Thanks
Hello, I cloned the repository: https://github.com/serenity-bdd/serenity-junit-starter and the Intellij doesn't find the class Ensure (import net.serenitybdd.screenplay.ensure.Ensure; ), in pom.xml I added the dependency: net.serenity-bdd serenity-ensure ${serenity.version} test
How can be solved this issue? Thanks
Try refreshing your IntelliJ indexes.
I am trying to create the runner class for Serenity BDD Cucumber project. But the SerenityRunner or CucumberWithSerenity classes can not be found even after importing the following packagesL
import net.serenitybdd.junit.runners.SerenityRunner; or import net.serenitybdd.cucumber.CucumberWithSerenity;