私はそれについていくつかの質問を見ました。エスプレッソ2 - 複数の活動をテストするには?
例えば、 Android Espresso testing app flow
しかし、上記のanwserはここでエスプレッソ2で動作していないが、マルチ活動テストは1 TESTFILEに許可されていない場合は、どのように複数のアクティビティをテストするための流れを作るために私のスニペット
@Rule
public ActivityTestRule<SplashActivity> mActivityTestRule = new ActivityTestRule<>(SplashActivity.class);
@Test
public void splashActivityTest() {
onView(withId(R.id.splash_container)).perform(swipeLeft());
onView(withId(R.id.splash_container)).perform(swipeLeft());
// launch the main activity
ViewInteraction appCompatButton = onView(
allOf(withId(R.id.introduction_goto_btn), withText("goToMainActivity"), isDisplayed()));
appCompatButton.perform(click());
// the hierarchy can't find HomeBtn , it still hold the Splash's View, so the code below will fail
onView(withId(R.id.home_btn)).check(ViewAssertions.matches(isDisplayed()));
}
のですか?
発信者と呼び出し先のアクティビティのスクリーンショットを共有できますか? –
clickを実行した後で、home_btnが表示されていることを確認する前に、いくつかのスリープを追加しようとしましたか? – jeprubio
@ 2BAB、ねえ、仲間。あなたはその問題を解決しましたか?私は同じことに直面している。 – AQU