diff options
| author | 2022-08-25 11:00:49 +0000 | |
|---|---|---|
| committer | 2022-08-25 11:00:49 +0000 | |
| commit | 951c0dcb4799b10c729f3b68d9538c212ad6f209 (patch) | |
| tree | 14f8f625d74b080c61725302fd0ace56231197d7 | |
| parent | 2774590fe5ced15d6c5efbb9f20de61c3f4d6759 (diff) | |
| parent | 7711b5aac281e8fd0e2996051d61fa3d3560f2d8 (diff) | |
Merge "Sleep after interacting with bubbles to stabilize test"
| -rw-r--r-- | libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt index 1950e486f34b..3ad92f87421b 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt @@ -21,6 +21,7 @@ import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice import androidx.test.uiautomator.By +import androidx.test.uiautomator.UiObject2 import androidx.test.uiautomator.Until import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter @@ -58,26 +59,27 @@ open class MultiBubblesScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen setup { test { for (i in 1..3) { - val addBubbleBtn = waitAndGetAddBubbleBtn() - addBubbleBtn?.run { addBubbleBtn.click() } ?: error("Add Bubble not found") + val addBubbleBtn = waitAndGetAddBubbleBtn() ?: error("Add Bubble not found") + addBubbleBtn.click() + SystemClock.sleep(1000) } val showBubble = device.wait( Until.findObject( By.res(SYSTEM_UI_PACKAGE, BUBBLE_RES_NAME) ), FIND_OBJECT_TIMEOUT - ) - showBubble?.run { showBubble.click() } ?: error("Show bubble not found") + ) ?: error("Show bubble not found") + showBubble.click() SystemClock.sleep(1000) } } transitions { - val bubbles = device.wait( + val bubbles: List<UiObject2> = device.wait( Until.findObjects( By.res(SYSTEM_UI_PACKAGE, BUBBLE_RES_NAME) ), FIND_OBJECT_TIMEOUT ) ?: error("No bubbles found") for (entry in bubbles) { - entry?.run { entry.click() } ?: error("Bubble not found") + entry.click() SystemClock.sleep(1000) } } |