Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a67281d authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Stabilize bubble tests

Increase timeout for finding element in accessibility and ignore bubbles message window that can appear for only 1 entry

Test: atest WMShellFlickerTestsBubbles
Bug: 288353767
Change-Id: I7c19f35d6552260bb3a6d56c83794243daa24296
parent 4e2f7920
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@ abstract class BaseBubbleScreen(flicker: LegacyFlickerTest) : BaseTest(flicker)
                    uid,
                    NotificationManager.BUBBLE_PREFERENCE_NONE
                )
                device.wait(
                    Until.gone(By.res(SYSTEM_UI_PACKAGE, BUBBLE_RES_NAME)),
                    FIND_OBJECT_TIMEOUT
                )
                testApp.exit(wmHelper)
            }

@@ -92,7 +96,7 @@ abstract class BaseBubbleScreen(flicker: LegacyFlickerTest) : BaseTest(flicker)
                supportedRotations = listOf(Rotation.ROTATION_0)
            )

        const val FIND_OBJECT_TIMEOUT = 2000L
        const val FIND_OBJECT_TIMEOUT = 4000L
        const val SYSTEM_UI_PACKAGE = SYSTEMUI_PACKAGE
        const val BUBBLE_RES_NAME = "bubble_view"
    }
+11 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.bubble
import android.content.Context
import android.graphics.Point
import android.platform.test.annotations.Presubmit
import android.tools.common.flicker.subject.layers.LayersTraceSubject
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
import android.tools.device.flicker.legacy.FlickerBuilder
import android.tools.device.flicker.legacy.LegacyFlickerTest
@@ -73,4 +74,14 @@ open class DragToDismissBubbleScreenTest(flicker: LegacyFlickerTest) : BaseBubbl
    open fun testAppIsAlwaysVisible() {
        flicker.assertLayers { this.isVisible(testApp) }
    }

    @Presubmit
    @Test
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
        flicker.assertLayers {
            this.visibleLayersShownMoreThanOneConsecutiveEntry(
                LayersTraceSubject.VISIBLE_FOR_MORE_THAN_ONE_ENTRY_IGNORE_LAYERS + listOf(testApp)
            )
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ class OpenActivityFromBubbleOnLocksreenTest(flicker: LegacyFlickerTest) :
                instrumentation.uiAutomation.syncInputTransactions()
                val showBubble =
                    device.wait(
                        Until.findObject(By.res("com.android.systemui", "bubble_view")),
                        Until.findObject(By.res(SYSTEM_UI_PACKAGE, BUBBLE_RES_NAME)),
                        FIND_OBJECT_TIMEOUT
                    )
                showBubble?.click() ?: error("Bubble notify not found")
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ open class SendBubbleNotificationTest(flicker: LegacyFlickerTest) : BaseBubbleSc
                    FIND_OBJECT_TIMEOUT
                )
                    ?: error("No bubbles found")
                device.waitForIdle()
            }
        }