I am testing a simple Cucumber BDD test on Android and getting a cucumber error
org.picocontainer.PicoCompositionException: Either the specified
parameters do not match any of the following constructors: [private
java.lang.Class()]; OR the constructors were not accessible for
'java.lang.Class'
I cannot figure out where this error is coming from. Am I missing something ?
My feature file
Scenario Outline: Test scenario
Given I have a TestActivity
Then I should see <text> on the display
Examples:
| text |
| 123 |
| test |
Step definition
@CucumberOptions(features = "features", format = "pretty")
public class TestActivitySteps extends ActivityInstrumentationTestCase2<TestActivity> {
public TestActivitySteps(Class<TestActivity> activityClass) {
super(activityClass);
}
@Given("^I have a TestActivity$")
public void I_have_a_TestActivity() {
assertNotNull(getActivity());
}
@Then("^I should see (\\S+) on the display$")
public void I_should_see_s_on_the_display(final String s) {
onView(withText(s)).check(matches(isDisplayed()));
}
}
NOTE:
- Android Studio: 1.0.2
- Gradle: 2.2.1
- Cucumber: 1.2.0
- Espresso: 2.0