[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Running Cucumber project created with JAVA using ECLIPSE

Maybe it could be that. Right now I have a parent package "cucumber" which has the Runner class "CucumberRunnerTest.java" and a child package which has the StepDefinitions.java and the feature file "my feature.feature". I just changed my POM and RunnerTestfiles to this now. I still cannot get the StepDefintion class to execute..but the BUILD shows as success.

@CucumberOptions(

features = "src/cucumber/features/",

glue={"src/cucumber/"},

dryRun = false,

monochrome = true

)


public class CucumberRunnerTest {


}

=====================================


<build>

    <plugins>

      <plugin>

      <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-compiler-plugin</artifactId>

        <version>3.3</version>

        <configuration>

        <encoding>UTF-8</encoding>

          <source>1.8</source>

          <target>1.8</target>Â

          <compilerArgument>-Werror</compilerArgument>

        </configuration>

      </plugin>

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-surefire-plugin</artifactId>

        <version>2.18.1</version>

        <dependencies>

         <dependency>

          <groupId>org.apache.maven.surefire</groupId>

          <artifactId>surefire-junit47</artifactId>

          <version>2.18.1</version>

         </dependency>

        </dependencies>

        <configuration>

     <includes>

ÂÂ Â Â Â Â Â Â <include>StepDefinitions1.java</include>

ÂÂ Â Â Â Â Â Â <include>CucumberRunnerTest.java</include>

     </includes>

        </configuration>

      </plugin>

    </plugins>

  </build>



Thanks!


On Fri, Oct 16, 2015 at 1:19 PM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
I triedÂhttps://github.com/czeczotka/cucumber-jvm-maven and it works.

I suspect your class is not invoked because it's not suffixed by Test, as in CucumberRunnerTest. See [1] for informations on how to include other test classes.

[1]Âhttps://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html


On Fri, Oct 16, 2015 at 3:22 PM, Matthew Piggott <mpiggott@xxxxxxxxxxxx> wrote:
This the m2e list, it is for the maven eclipse integration. The maven users list is probably somewhere off maven.apache.org

On 16 October 2015 at 15:00, Kashif BHATTI <kashifzone@xxxxxxxxx> wrote:
I thought this is the Maven Users list.ÂI did take a look at what you sent. However, when I right-click on the POM.xml it Builds successfully but does not execute the Step Definition class. Here is what my Runner Class looks like:

@RunWith(Cucumber.class)

@CucumberOptions(

features =Â"src/cucumber/",

glue={"src/cucumber/features"},

dryRun =Âtrue,

monochrome =Âtrue

)


publicÂclassÂCucumberRunner {


}



Here is the POM.xml

<build>

   ÂÂ<plugins>

     ÂÂ<plugin>

     Â <groupId>org.apache.maven.plugins</groupId>

       ÂÂ<artifactId>maven-compiler-plugin</artifactId>

       ÂÂ<version>3.3</version>

       ÂÂ<configuration>

       Â <encoding>UTF-8</encoding>

         ÂÂ<source>1.8</source>

         ÂÂ<target>1.8</target>Â

         ÂÂ<compilerArgument>-Werror</compilerArgument>

       ÂÂ</configuration>

     ÂÂ</plugin>

     ÂÂ<plugin>

       ÂÂ<groupId>org.apache.maven.plugins</groupId>

       ÂÂ<artifactId>maven-surefire-plugin</artifactId>

       ÂÂ<version>2.18.1</version>

       ÂÂ<dependencies>

        ÂÂ<dependency>

         ÂÂ<groupId>org.apache.maven.surefire</groupId>

         ÂÂ<artifactId>surefire-junit47</artifactId>

         ÂÂ<version>2.18.1</version>

        ÂÂ</dependency>

       ÂÂ</dependencies>

     ÂÂ</plugin>

   ÂÂ</plugins>

 ÂÂ</build>


Please advise. Thanks


On Thu, Oct 15, 2015 at 1:35 PM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
This is not really an m2e question, you should rather ask the Maven Users list.

Anyways, first hit on google for "Cucumber Maven Project" :Âhttp://blog.czeczotka.com/2014/07/22/cucumber-jvm-with-maven-in-minutes/

On Thu, Oct 15, 2015 at 4:23 PM, Kashif BHATTI <kashifzone@xxxxxxxxx> wrote:
Hello,

I have created an initial Cucumber Maven Project in ECLIPSE and the eventual task that I have been asked to do is to be able to run it using Maven from the command line. I have installed Maven..I also have my POM file but I have absolutely no idea how to get Maven test running from command line Termina (I know with TestNG you can have an xml file configured into the POM xml and then run it. With TestNG it usually runs by using the @Test annotation so not sure what annotation in Cucumber will be used to run the POM file)

Can someone please tell me (would be greatly appreciated if someone just could paste exactly what I need to put into the POM file that is missing). Here is the POM file I used with my Cucumber MAVEN Project

<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">

ÂÂ<modelVersion>4.0.0</modelVersion>


ÂÂ<groupId>com.cucumber</groupId>

ÂÂ<artifactId>cucumberProject</artifactId>

ÂÂ<version>0.0.1-SNAPSHOT</version>

ÂÂ<packaging>jar</packaging>


ÂÂ<name>cucumberProject</name>

ÂÂ<url>http://maven.apache.org</url>


ÂÂ<properties>

 ÂÂ<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

ÂÂ</properties>


ÂÂ<dependencies>

 ÂÂ<dependency>

ÂÂ<groupId>junit</groupId>

ÂÂ<artifactId>junit</artifactId>

ÂÂ<version>4.12</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>info.cukes</groupId>

ÂÂ<artifactId>cucumber-core</artifactId>

ÂÂ<version>1.2.4</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>info.cukes</groupId>

ÂÂ<artifactId>cucumber-java</artifactId>

ÂÂ<version>1.2.4</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>info.cukes</groupId>

ÂÂ<artifactId>cucumber-junit</artifactId>

ÂÂ<version>1.2.4</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>info.cukes</groupId>

ÂÂ<artifactId>cucumber-html</artifactId>

ÂÂ<version>0.2.3</version>

 ÂÂ</dependency>Â

 ÂÂ<dependency>

ÂÂ<groupId>info.cukes</groupId>

ÂÂ<artifactId>cucumber-jvm-deps</artifactId>

ÂÂ<version>1.0.5</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>net.masterthought</groupId>

ÂÂ<artifactId>cucumber-reporting</artifactId>

ÂÂ<version>0.4.0</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>info.cukes</groupId>

ÂÂ<artifactId>cucumber-testng</artifactId>

ÂÂ<version>1.2.4</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>info.cukes</groupId>

ÂÂ<artifactId>gherkin</artifactId>

ÂÂ<version>2.12.2</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>org.hamcrest</groupId>

ÂÂ<artifactId>hamcrest-all</artifactId>

ÂÂ<version>1.3</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>org.seleniumhq.selenium</groupId>

ÂÂ<artifactId>selenium-java</artifactId>

ÂÂ<version>2.47.1</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>org.seleniumhq.selenium</groupId>

ÂÂ<artifactId>selenium-server</artifactId>

ÂÂ<version>2.47.1</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>io.appium</groupId>

ÂÂ<artifactId>java-client</artifactId>

ÂÂ<version>3.2.0</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>org.testng</groupId>

ÂÂ<artifactId>testng</artifactId>

ÂÂ<version>6.9.6</version>

 ÂÂ</dependency>

 ÂÂ<dependency>

ÂÂ<groupId>org.apache.maven.surefire</groupId>

ÂÂ<artifactId>surefire-api</artifactId>

ÂÂ<version>2.18.1</version>

 ÂÂ</dependency>

ÂÂ</dependencies>

ÂÂ

</project>



Thanks


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users



--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, thenÂhttp://goo.gl/tnBgH5

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users



--
"Have you tried turning it off and on again" - The IT Crowd
And if that fails, thenÂhttp://goo.gl/tnBgH5

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users