From fed3f2fe91b181fd4fd00db7a6b4537f9a64fbff Mon Sep 17 00:00:00 2001 From: Oana Horvath Date: Thu, 21 May 2020 18:41:00 +0300 Subject: [PATCH] for #10759: close notification shade if still open (#10819) --- .../java/org/mozilla/fenix/ui/MediaNotificationTest.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt index b7964bec2..d935fdea1 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/MediaNotificationTest.kt @@ -4,6 +4,7 @@ package org.mozilla.fenix.ui +import androidx.test.uiautomator.UiSelector import okhttp3.mockwebserver.MockWebServer import org.junit.After import org.junit.Before @@ -43,6 +44,12 @@ class MediaNotificationTest { @After fun tearDown() { mockWebServer.shutdown() + // verify if the notification tray is expanded and should be closed before the next test + val notificationShade = + mDevice.findObject(UiSelector().resourceId("com.android.systemui:id/notification_stack_scroller")) + + if (notificationShade.exists()) + mDevice.pressBack() } @Test