Closes #12645: Re-enable mediaSystemNotificationInPrivateModeTest

pull/90/head
Oana Horvath 4 years ago
parent b94a6c244b
commit cf69058ce8

@ -8,7 +8,6 @@ import androidx.test.uiautomator.UiSelector
import okhttp3.mockwebserver.MockWebServer
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
@ -61,6 +60,7 @@ class MediaNotificationTest {
}.enterURLAndEnterToBrowser(videoTestPage.url) {
mDevice.waitForIdle()
clickMediaPlayerPlayButton()
waitForPlaybackToStart()
}.openNotificationShade {
verifySystemNotificationExists(videoTestPage.title)
clickMediaSystemNotificationControlButton("Pause")
@ -136,7 +136,6 @@ class MediaNotificationTest {
}
}
@Ignore("Flaky test, temp disabled: https://github.com/mozilla-mobile/fenix/issues/12645")
@Test
fun mediaSystemNotificationInPrivateModeTest() {
val audioTestPage = TestAssetHelper.getAudioPageAsset(mockWebServer)
@ -160,6 +159,7 @@ class MediaNotificationTest {
verifyMediaIsPaused()
}.openTabDrawer {
closeTab()
verifySnackBarText("Private tab closed")
}
mDevice.openNotification()

@ -12,14 +12,12 @@ import android.net.Uri
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.BundleMatchers
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.RootMatchers.isDialog
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
import androidx.test.espresso.matcher.ViewMatchers.Visibility
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
@ -33,7 +31,6 @@ import androidx.test.uiautomator.By.text
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.Until
import androidx.test.uiautomator.Until.hasObject
import org.hamcrest.CoreMatchers.allOf
import org.hamcrest.CoreMatchers.containsString
import org.junit.Assert.assertTrue
@ -328,14 +325,7 @@ class BrowserRobot {
}
fun clickMediaPlayerPlayButton() {
mDevice.waitNotNull(
hasObject(
By
.clazz("android.widget.Button")
.textContains("Play")
),
waitingTime
)
mediaPlayerPlayButton().waitForExists(waitingTime)
mediaPlayerPlayButton().click()
}
@ -459,9 +449,9 @@ private fun tabsCounter() = onView(withId(R.id.counter_box))
private fun mediaPlayerPlayButton() =
mDevice.findObject(
By
.clazz("android.widget.Button")
.textContains("Play")
UiSelector()
.className("android.widget.Button")
.text("Play")
)
private fun assertBlueDot() {

Loading…
Cancel
Save