mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-24 08:10:45 +01:00
adding helper for waiting until view is ready
This commit is contained in:
parent
557609c175
commit
5284765149
@ -17,9 +17,19 @@
|
||||
package im.vector.app.espresso.tools
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import androidx.test.espresso.Espresso
|
||||
import androidx.test.espresso.matcher.ViewMatchers
|
||||
import im.vector.app.activityIdlingResource
|
||||
import im.vector.app.waitForView
|
||||
import im.vector.app.withIdlingResource
|
||||
import org.hamcrest.Matcher
|
||||
|
||||
inline fun <reified T : Activity> waitUntilActivityVisible(noinline block: (() -> Unit) = {}) {
|
||||
withIdlingResource(activityIdlingResource(T::class.java), block)
|
||||
}
|
||||
|
||||
fun waitUntilViewVisible(viewMatcher: Matcher<View>) {
|
||||
Espresso.onView(ViewMatchers.isRoot()).perform(waitForView(viewMatcher))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user