[fenix] For https://github.com/mozilla-mobile/fenix/issues/24978 re-enable media notification UI tests

pull/600/head
AndiAJ 2 years ago committed by mergify[bot]
parent a2ba4d710f
commit 908d95afb1

@ -11,11 +11,11 @@ import mozilla.components.concept.engine.mediasession.MediaSession
import okhttp3.mockwebserver.MockWebServer import okhttp3.mockwebserver.MockWebServer
import org.junit.After import org.junit.After
import org.junit.Before import org.junit.Before
import org.junit.Ignore
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.components
import org.mozilla.fenix.helpers.AndroidAssetDispatcher import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.FeatureSettingsHelper
import org.mozilla.fenix.helpers.HomeActivityTestRule import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.RetryTestRule import org.mozilla.fenix.helpers.RetryTestRule
import org.mozilla.fenix.helpers.TestAssetHelper import org.mozilla.fenix.helpers.TestAssetHelper
@ -35,6 +35,7 @@ class MediaNotificationTest {
private lateinit var mockWebServer: MockWebServer private lateinit var mockWebServer: MockWebServer
private lateinit var mDevice: UiDevice private lateinit var mDevice: UiDevice
val featureSettingsHelper = FeatureSettingsHelper()
@get:Rule @get:Rule
val activityTestRule = HomeActivityTestRule() val activityTestRule = HomeActivityTestRule()
@ -55,6 +56,7 @@ class MediaNotificationTest {
dispatcher = AndroidAssetDispatcher() dispatcher = AndroidAssetDispatcher()
start() start()
} }
featureSettingsHelper.setTCPCFREnabled(false)
} }
@After @After
@ -62,7 +64,6 @@ class MediaNotificationTest {
mockWebServer.shutdown() mockWebServer.shutdown()
} }
@Ignore("Failing with ANR: https://github.com/mozilla-mobile/fenix/issues/15754")
@Test @Test
fun videoPlaybackSystemNotificationTest() { fun videoPlaybackSystemNotificationTest() {
val videoTestPage = TestAssetHelper.getVideoPageAsset(mockWebServer) val videoTestPage = TestAssetHelper.getVideoPageAsset(mockWebServer)
@ -96,7 +97,6 @@ class MediaNotificationTest {
mDevice.pressBack() mDevice.pressBack()
} }
@Ignore("Failing with frequent ANR: https://bugzilla.mozilla.org/show_bug.cgi?id=1764605")
@Test @Test
fun mediaSystemNotificationInPrivateModeTest() { fun mediaSystemNotificationInPrivateModeTest() {
val audioTestPage = TestAssetHelper.getAudioPageAsset(mockWebServer) val audioTestPage = TestAssetHelper.getAudioPageAsset(mockWebServer)

@ -556,8 +556,22 @@ class BrowserRobot {
} }
fun clickMediaPlayerPlayButton() { fun clickMediaPlayerPlayButton() {
mediaPlayerPlayButton().waitForExists(waitingTime) for (i in 1..RETRY_COUNT) {
mediaPlayerPlayButton().click() try {
mediaPlayerPlayButton().waitForExists(waitingTime)
mediaPlayerPlayButton().click()
break
} catch (e: UiObjectNotFoundException) {
if (i == RETRY_COUNT) {
throw e
} else {
browserScreen {
}.openThreeDotMenu {
}.refreshPage { }
}
}
}
} }
/** /**

Loading…
Cancel
Save