Skip to content

Commit

Permalink
For #2130 - Fix fileDownloadTest
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronMT committed Dec 5, 2022
1 parent 3ef62ea commit 511886f
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class NotificationRobot {
val downloadFilename = mDevice.findObject(UiSelector().text(fileName))

while (!notificationFound) {
notificationTray.swipeUp(2)
scrollToEnd()
notificationFound = mDevice.findObject(notification).waitForExists(waitingTime)
}
assertTrue(notificationFound)
Expand Down Expand Up @@ -95,3 +95,11 @@ private val systemMediaNotification =
.className("android.view.ViewGroup")
.packageName("com.android.systemui")
)

private fun notificationTray() = UiScrollable(
UiSelector().resourceId("com.android.systemui:id/notification_stack_scroller")
).setAsVerticalList()

private fun scrollToEnd() {
notificationTray().scrollToEnd(1)
}

0 comments on commit 511886f

Please sign in to comment.