From f66bd4ffe9e44a0826f9412239ebfc6cd756d7e6 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 28 Jan 2022 13:20:56 +0000 Subject: [PATCH] waiting for the emoji to become visible instead of a hardcoded sleep --- .../java/im/vector/app/ui/robot/MessageMenuRobot.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vector/src/androidTest/java/im/vector/app/ui/robot/MessageMenuRobot.kt b/vector/src/androidTest/java/im/vector/app/ui/robot/MessageMenuRobot.kt index 934c6c76a1..5973dc3473 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/robot/MessageMenuRobot.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/robot/MessageMenuRobot.kt @@ -17,12 +17,16 @@ package im.vector.app.ui.robot import androidx.test.espresso.Espresso.pressBack +import androidx.test.espresso.matcher.ViewMatchers.withId import androidx.test.espresso.matcher.ViewMatchers.withText import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn import com.adevinta.android.barista.interaction.BaristaListInteractions.clickListItem import com.google.android.material.bottomsheet.BottomSheetBehavior import im.vector.app.R +import im.vector.app.espresso.tools.waitUntilActivityVisible +import im.vector.app.espresso.tools.waitUntilViewVisible import im.vector.app.features.home.room.detail.timeline.edithistory.ViewEditHistoryBottomSheet +import im.vector.app.features.reactions.EmojiReactionPickerActivity import im.vector.app.interactWithSheet import java.lang.Thread.sleep @@ -54,7 +58,10 @@ class MessageMenuRobot( fun addReactionFromEmojiPicker() { clickOn(R.string.message_add_reaction) // Wait for emoji to load, it's async now - sleep(2000) + waitUntilActivityVisible { + waitUntilViewVisible(withId(R.id.emojiRecyclerView)) + waitUntilViewVisible(withText("😀")) + } clickListItem(R.id.emojiRecyclerView, 4) autoClosed = true }