マイアクティビティ 'MainActivity'は、いくつかの条件のもとで、自分自身の別のアクティビティオンタップを開始する必要があります。アクティビティが別のアクティビティを開始したため、アクティビティのタイムアウトを開始する
私はMainActivityのテストを実行して、それらの条件でAnotherActivityが開始されていることを確信します。
MainActivityがScreenに表示されるのを待っているように見えるので、私のEspressoテストでMainActivityが起動しません。私は他の活動を始めているので、これは起こりません。アクティビティは、ActivityTestRuleを介して起動されます。
私のエスプレッソ・テストを実行しているとき、私は次の例外を得た:
java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=com.djoglobal.corebelt.debug/com.djo.compex.corebelt.ui.MainActivity } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1488804986217 and now the last time the queue went idle was: 1488804986217. If these numbers are the same your activity might be hogging the event queue.
at android.support.test.runner.MonitoringInstrumentation.startActivitySync(MonitoringInstrumentation.java:360)
at android.support.test.rule.ActivityTestRule.launchActivity(ActivityTestRule.java:219)
at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:268)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at tools.fastlane.screengrab.locale.LocaleTestRule$1.evaluate(LocaleTestRule.java:32)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:262)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1932)
私はonResumeで「AnotherActivity」を開始した場合、私は同じ動作をします。
私はこのシナリオをテストするためにエスプレッソ2.2.1
任意のアイデアを使用していますか?
この問題の解決策をお探しですか? – makovkastar