From 2fb32e8e2c7ea07730376a5f0631256cb2450779 Mon Sep 17 00:00:00 2001 From: Victor Andreasson Date: Tue, 7 May 2024 23:33:20 +0200 Subject: [PATCH] Short sleep before finding root view in onRecyclerView --- .../java/com/orgzly/android/espresso/util/EspressoUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/androidTest/java/com/orgzly/android/espresso/util/EspressoUtils.java b/app/src/androidTest/java/com/orgzly/android/espresso/util/EspressoUtils.java index 5dddd0038..b6b1941a3 100644 --- a/app/src/androidTest/java/com/orgzly/android/espresso/util/EspressoUtils.java +++ b/app/src/androidTest/java/com/orgzly/android/espresso/util/EspressoUtils.java @@ -23,6 +23,7 @@ import android.content.res.Resources; import android.os.Build; +import android.os.SystemClock; import android.text.Spanned; import android.text.style.ClickableSpan; import android.view.KeyEvent; @@ -187,6 +188,7 @@ public static ViewInteraction onSavedSearch(int position) { } public static ViewInteraction onRecyclerViewItem(@IdRes int recyclerView, int position, @IdRes int childView) { + SystemClock.sleep(500); onView(isRoot()).perform(waitId(recyclerView, 5000)); onView(withId(recyclerView)).perform(RecyclerViewActions.scrollToPosition(position)); return onView(new EspressoRecyclerViewMatcher(recyclerView)