Maven + Cucumber-JVM + Selenium HTML tests?

1,365 views
Skip to first unread message

laredotornado

unread,
Feb 7, 2012, 4:52:16 PM2/7/12
to Cukes
Hi,

We're using Maven 3.0.3 with the Cucumber JVM and Selenium tests
exported as HTML files from the latest Firefox IDE. Does anyone have
a sample configuration illustrating how to run these tests as a Maven
task? I realize we could export our tests to a WebDriver format,
however I've noticed that the Selenium WebDriver doesn't support the
same commands that the IDE supports.

Thanks for your help, - Dave

Robert

unread,
Feb 8, 2012, 7:14:19 PM2/8/12
to cu...@googlegroups.com
We are currently using Maven (3.0.3) with Cucumber-JVM and Selenium Webdriver.  We opted out of the HTMLified version of Selenium and went with Webdriver and the pageobject pattern.  We are pretty happy thus far with the setup.  Here is a snippet of our pom file.

<properties>
<selenium.version>2.17.0</selenium.version>
<cucumber-jvm.version>1.0.0.RC13</cucumber-jvm.version>
<junit.version>4.10</junit.version>
<cuke.tags>@demo,@selenium</cuke.tags>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<classpathScope>test</classpathScope>
<mainClass>cucumber.cli.Main</mainClass>
<arguments>
<argument>--format</argument>
<argument>pretty</argument>
<argument>--format</argument>
<argument>html</argument>
<argument>--out</argument>
<argument>./results</argument>
<argument>--tags</argument>
<argument>${cuke.tags}</argument>
<argument>--glue</argument>
<argument>com.myorg.spt.qa.stepdefs</argument>
<argument>src/test/resources/features</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

This sort of configuration ignores JUnit tests and opts to run Cucumber with the --format pretty --format html and --tags options by using the exec-maven-plugin

Thomas Sundberg

unread,
Feb 10, 2012, 2:19:22 AM2/10/12
to cu...@googlegroups.com

I wrote an example a while ago where I execute Selenium from Cucumber
and drive everything using Maven. It is not exactly the same scenario
as you describe, but you might pick up and idea or two from it.

http://thomassundberg.wordpress.com/2011/10/18/testing-a-web-application-with-selenium-2/

HTH
Thomas

>
> Thanks for your help, - Dave
>

> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>

--
Thomas Sundberg
M. Sc. in Computer Science

Mobile: +46 70 767 33 15
Blog: http://thomassundberg.wordpress.com/
Twitter: @thomassundberg

Better software through faster feedback

Reply all
Reply to author
Forward
0 new messages