[JVM] Feature/Scenario ignored on JUnit

329 views
Skip to first unread message

Alexis Mas

unread,
May 22, 2013, 4:09:45 AM5/22/13
to cu...@googlegroups.com
I'm trying to run a simple scenario with one step, but it's ignored.

OS: Ubuntu 13.04
Cucumber: cucumber-jvm-1.1.3

Stepdef in ActivityStepdefs.java

public class ActivityStepdefs {
   
@Given("^I launch the activity \"([^\"]*)\"$")
   
public void iLaunchActivity(String activityName){
         
//do something  
   
}
}



RunCukesTest.java
@RunWith(Cucumber.class)
@Cucumber.Options(
        glue
= {"com.axxiss.RoBDD.steps"},
        features
= {"src/test/resources/features/"},
        format
= "pretty")
public class RunCukesTest {
}




When I run the test I encounter this issue:


Test '.Scenario: Activity exists.Given I launch the activity "com.axxiss.RoBDD.app.SampleActivity"' ignored
Test '.Feature: Activity stepdefs test.Scenario: Activity exists' ignored


You can implement missing steps with the snippets below:

@Given("^I launch the activity \"([^\"]*)\"$")
public void I_launch_the_activity(String arg1) throws Throwable {
   
// Express the Regexp above with the code you wish you had
   
throw new PendingException();
}

Feature: Activity stepdefs test

 
Scenario: Activity exists                                           # ActivityStepdefs.feature:3
   
Given I launch the activity "com.axxiss.RoBDD.app.SampleActivity"
Wrong test finished. Last started: [] stopped: Scenario: Activity exists; class org.junit.runner.Description


Björn Rasmusson

unread,
May 22, 2013, 7:32:14 AM5/22/13
to cu...@googlegroups.com

Alexis Mas wrote:
I'm trying to run a simple scenario with one step, but it's ignored.

OS: Ubuntu 13.04
Cucumber: cucumber-jvm-1.1.3

Stepdef in ActivityStepdefs.java

public class ActivityStepdefs {
   
@Given("^I launch the activity \"([^\"]*)\"$")
   
public void iLaunchActivity(String activityName){
         
//do something  
   
}
}



RunCukesTest.java
@RunWith(Cucumber.class)
@Cucumber.Options(
        glue
= {"com.axxiss.RoBDD.steps"},
        features
= {"src/test/resources/features/"},
        format
= "pretty")
public class RunCukesTest {
}



On Windows I get problems with capital letters in the glue options packages.
Try: glue = {"com.axxiss.robdd.steps"}
 
Note that using the pretty formatter in cucumber-jvm-1.1.3 is not recommended due to the bug (which manifests itself with scanrios with two or more steps):
https://github.com/cucumber/gherkin/pull/252
In 1.1.3 the progress formatter is a better choice.
 
Regards
Björn

 
Reply all
Reply to author
Forward
0 new messages