How to run cucumber-jvm project as Java application using Eclipse IDE

20 October, 2015
Run the entire cucumber-jvm project as Java application with Eclipse:

1: Right click on the project and select "Run Configurations"

2: Under the Java Application Launch Perspective, press the 'New' button to create new "Java Application" execution.

3: Under the "Main" tab....
3.1 Enter your Project name in the "Project:" field....
3.2 Enter "cucumber.api.cli.Main" without quotes for the "Main class" field..



4: Under the tab for "Arguments"
4.1 For "Program Arguments", enter...

${selected_resource_loc}
--glue com.your.glue.location
--plugin pretty
--monochrome

4.2 Under "VM Arguments..."
-ea

if you want to pass in system parameters, do so here
-DtargetAppType=MobileWebApp

This will turn on java assert() statements, which is need to allow the Then steps to throw assertion exceptions if the code a test is testing is broken.

STEPS 1 - 4 will be saved so you will not have to repeat them again.

5. Click the "Run" button.


References
Cucumber-IDE-support



No comments:

Post a Comment