[JS] Has anyone used Cucumber-JS with Maven

389 views
Skip to first unread message

Stuart Pretorius

unread,
Jan 8, 2014, 11:50:26 AM1/8/14
to cu...@googlegroups.com
We'd like to use cucumber.js to test our JS code at build time with Maven across multiple platforms ( mainly Windows and Linux ). Has anyone had any luck running cucumber.js with the Maven Exec plugin? We'd like to use phantom.js or a derivative, would you recommend any headless environment in particular? 

At the moment we have a very basic feature, step and world file setup and the below entry in our POM file. This however does not work, I tried to use the cmd executable and the pass arguments but both failed with the below errors. Has anyone had any luck with sort of build setup?

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <id>run-ui-cucumber-tests</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>cucumber-js</executable>
                    <workingDirectory>../cucumber-ui-tests</workingDirectory>
                </configuration>
            </plugin>

Error :  ...Command execution failed. Cannot run program "cucumber-js"...


Julien Biezemans

unread,
Jan 12, 2014, 5:20:13 AM1/12/14
to cu...@googlegroups.com
I have no experience with Maven at all but doesn't that error message mean Maven cannot find a "cucumber-js" executable? Could you specify the absolute path to cucumber.js?
 

--
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/groups/opt_out.



--
Julien.

Founder, Cucumber Ltd.
Message has been deleted

Stuart Pretorius

unread,
Jan 29, 2014, 7:11:34 AM1/29/14
to cu...@googlegroups.com
Hey Julien

Apologies for the delay in response but have only recently had the time to come back to this. I have updated my maven plugin to run as follows which seems to be working with the following error. ( I do have a controlled failing test )

Maven

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <id>run-ui-cucumber-tests</id>
            <phase>compile</phase>
            <goals>
                <goal>exec</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <executable>cmd</executable>
        <arguments>
            <argument>/C</argument>
            <argument>C:\Users\spretorius\AppData\Roaming\npm\cucumber-js</argument>
        </arguments>
    </configuration>
</plugin>

Outputs

[INFO] --- exec-maven-plugin:1.2.1:exec (run-ui-cucumber-tests) @ cucumber-js-tests ---
←[31mF←[0m[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.704s
[INFO] Finished at: Wed Jan 29 12:01:55 GMT 2014
[INFO] Final Memory: 11M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (run-ui-cucumber-tests) on project cucumber-js-tests: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]


Summary

The part that is interesting is that it seems to be outputting the first part of the cucumber output but not the rest. eg. ( [31mF←[0m[INFO and F--...... ) See below. Any ideas?


Maven output

[31mF←[0m[INFO


Command line output

F--......

(::) failed steps (::)

No phantom-proxy bridge present

Failing scenarios:
c:\xampp\htdocs\wol-development\anywhereart

3 scenarios (1 failed, 2 passed)
9 steps (1 failed, 2 skipped, 6 passed)

Julien Biezemans

unread,
Feb 10, 2014, 10:38:11 AM2/10/14
to cu...@googlegroups.com
Cucumber seems to run well. One of your step definitions is failing for some reason. The line above appears to be the error. What's that phantom-proxy thing there?
Reply all
Reply to author
Forward
0 new messages