Parameters cucumber.options dont work in mvn command line

528 views
Skip to first unread message

lucas....@despegar.com

unread,
Apr 7, 2015, 9:57:24 AM4/7/15
to cu...@googlegroups.com
Hi!
I have this problem...
When i run by command line " mvn clean test -Dcucumber.options="--tags @smoke" ", maven run all the test, not only the test marked with the tag "@smoke".

If i set a enviroment variable for example with the same tag, works ok! I mean, only run the test marked with tag "@smoke"
Example: export CUCUMBER_OPTIONS="--tags @smoke"

What could be the problem?

My POM:
<dependencies>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.45.0</version>
</dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.6</source>
                    <target>1.6</target>
<!--                     <useIncrementalCompilation>false</useIncrementalCompilation> -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
            </plugin>
        </plugins>
    </build>

aslak hellesoy

unread,
Apr 7, 2015, 10:00:33 AM4/7/15
to Cucumber Users
On Tue, Apr 7, 2015 at 2:48 PM, <lucas....@despegar.com> wrote:
Hi!
I have this problem...
When i run by command line " mvn clean test -Dcucumber.options="--tags @smoke" ", maven run all the test, not only the test marked with the tag "@smoke".


That's odd. What happens if you try this:

    mvn test -Dcucumber.options="--help"

Or this

    mvn test -Dcucumber.options="--this-should-fail"

Aslak
 

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lucas....@despegar.com

unread,
Apr 7, 2015, 10:13:40 AM4/7/15
to cu...@googlegroups.com
Hi! Thanks for the faster answer!

I've tried.
Nothing happens ! Maven run all the tests without any message. 

lmatello@lucas-530U3C-530U4C:~/cucumber/cucumber-automation-2$ mvn test -Dcucumber.options="--help"
[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Cucumber-Java-JUnit Project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cucumber-automation-2 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/lmatello/cucumber/cucumber-automation-2/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ cucumber-automation-2 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cucumber-automation-2 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ cucumber-automation-2 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ cucumber-automation-2 ---
[INFO] Surefire report directory: /home/lmatello/cucumber/cucumber-automation-2/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.despegar.cucumber.RunCukesTest
# language: es
Característica: Prueba de que mi framework funciona.
prueba del given
prueba del when
prueba del then

  @smoke
  Escenario: Mi primer test  # com/despegar/cucumber/features/myTest.feature:5
    Dado prueba del given    # StepDefinitions.navegoPaginaResultadoDeBusqueda()
    Cuando prueba del when   # StepDefinitions.seleccionoComprar()
    Entonces prueba del then # StepDefinitions.veoPaginaCheckOut()
Feature: Prueba de la caja de busqueda de la home de vuelos.
^CDestroying 1 processes
Destroying process..
Destroyed 1 processes

lucas....@despegar.com

unread,
Apr 7, 2015, 1:42:04 PM4/7/15
to cu...@googlegroups.com
Hi Aslak!
I found the issue...
The problem was my console... I use "terminator" in linux. I dont know why, but in this console, the parameter "cucumber.options" dont work when I use mvn test.

I used the default terminal of ubuntu and i can run all test with and without parameters well !

Thanks a lot!
Reply all
Reply to author
Forward
0 new messages