我正在Android上测试一个简单的Cucumber BDD测试并获得黄瓜错误
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'
我无法弄清楚这个错误来自哪里。 我错过了什么吗?
我的专题文件
Scenario Outline: Test scenario
Given I have a TestActivity
Then I should see <text> on the display
Examples:
| text |
| 123 |
| test |
步骤定义
@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()));
}
}
注:
答案 0 :(得分:2)
public TestActivitySteps(Class<TestActivity> activityClass) {
super(activityClass);
}
我改为
后错误消失了public TestActivitySteps(TestActivity activityClass) {
super(activityClass);
}