Robotium없이 ActivityInstrumentationTestCase2 만 사용하여 새 작업을 시작하는 버튼을 테스트하려고하는데 잘 작동하지만 다음 테스트 케이스를 실행하려고하면 시작할 수 없습니다. .ActivityInstrumentationTestCase2는 작업 전환 후 새 테스트를 설정할 수 없습니다.
question에 설명 된 바에 따라 다음 활동에서 테스트를 계속하고 클릭 수를 계속할 수 있었지만 여러 기능으로 테스트를 분리하고 싶습니다.
다음 코드를 사용하여 설치 프로그램에서 새로운 작업을 시작하려고했지만 작동하지 않았으며 각 기능에 대해 동일한 작업을 시도했지만 작동하지 않았습니다.
Instrumentation instrumentation = getInstrumentation();
Instrumentation.ActivityMonitor monitor = instrumentation.addMonitor(AuthenticateActivity.class.getName(), null, false);
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName(instrumentation.getTargetContext(), AuthenticateActivity.class.getName());
instrumentation.startActivitySync(intent);
Activity currentActivity = instrumentation.waitForMonitorWithTimeout(monitor, 5);
어떻게하면 새로운 활동을 시작하고 다음 테스트 기능을 계속 실행할 수 있습니까?