Commit 94d239f2 authored by Mugurell's avatar Mugurell Committed by Richard Pospesel
Browse files

Bug 1812518 - Fix UI tests affected by the refactoring.

parent 9eb98437
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -57,8 +57,10 @@ class CollectionTest {
        featureSettingsHelper.resetAllFeatureFlags()
    }

    @Test

    // open a webpage, and add currently opened tab to existing collection
    @Ignore("Failing, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1812580")
    @Test
    fun mainMenuSaveToExistingCollection() {
        val firstWebPage = getGenericAsset(mockWebServer, 1)
        val secondWebPage = getGenericAsset(mockWebServer, 2)
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ class DownloadFileTypesTest(fileName: String) {
            verifyDownloadPrompt(downloadFile)
        }.clickDownload {
            verifyDownloadNotificationPopup()
        }.closePrompt {
        }.closeCompletedDownloadPrompt {
        }.openThreeDotMenu {
        }.openDownloadsManager {
            waitForDownloadsListToExist()
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ class DownloadTest {
            verifyDownloadPrompt(downloadFile)
        }.clickDownload {
            verifyDownloadNotificationPopup()
        }.closePrompt { }
        }
        mDevice.openNotification()
        notificationShade {
            verifySystemNotificationExists("Download completed")
+11 −3
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.RootMatchers.isDialog
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
import androidx.test.espresso.matcher.ViewMatchers.withId
@@ -82,6 +81,13 @@ class DownloadRobot {
            return Transition()
        }

        fun closeCompletedDownloadPrompt(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
            closeCompletedDownloadButton().click()

            BrowserRobot().interact()
            return BrowserRobot.Transition()
        }

        fun closePrompt(interact: BrowserRobot.() -> Unit): BrowserRobot.Transition {
            closePromptButton().click()

@@ -177,12 +183,14 @@ private fun assertDownloadNotificationPopup() {
    )
}

private fun closeCompletedDownloadButton() =
    onView(withId(R.id.download_dialog_close_button))

private fun closePromptButton() =
    onView(withContentDescription("Close"))
    onView(withId(R.id.close_button))

private fun downloadButton() =
    onView(withText("Download"))
        .inRoot(isDialog())
        .check(matches(isDisplayed()))

private fun openDownloadButton() =