我正在尝试测试一个活动,包括来自 android-annotations 2.7 的注释,如 @EActivity、@ViewById 等。由于 NoClassDefFoundError,每个测试都失败了。有没有人有一个工作示例如何将 Robotium 与 Android 注释相结合?这是我的测试用例:
package de.abc.view;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.Button;
import com.jayway.android.robotium.solo.Solo;
import de.abc.R;
public class WorktimeActivityTest extends ActivityInstrumentationTestCase2<WorktimeActivity_>{
private Solo solo;
public WorktimeActivityTest() {
super(WorktimeActivity_.class);
}
public void setUp() throws Exception{
solo = new Solo(getInstrumentation(), getActivity());
}
public void testSelectWorkday() {
Button button = (Button) solo.getView(R.id.selectWorkday);
solo.clickOnView(button);
}
@Override
public void tearDown() throws Exception{
solo.finishOpenedActivities();
}
}