1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.fenix.ui
7 import androidx.core.net.toUri
10 import org.junit.runner.RunWith
11 import org.junit.runners.Parameterized
12 import org.mozilla.fenix.customannotations.SmokeTest
13 import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
14 import org.mozilla.fenix.helpers.TestSetup
15 import org.mozilla.fenix.ui.robots.downloadRobot
18 * Test for verifying downloading a list of different file types:
19 * - Initiates a download
20 * - Verifies download prompt
21 * - Verifies downloading of varying file types and the appearance inside the Downloads listing.
23 @RunWith(Parameterized::class)
24 class DownloadFileTypesTest(fileName: String) : TestSetup() {
25 /* Remote test page managed by Mozilla Mobile QA team at https://github.com/mozilla-mobile/testapp */
26 private val downloadTestPage = "https://storage.googleapis.com/mobile_test_assets/test_app/downloads.html"
27 private var downloadFile: String = fileName
30 val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
33 // Creating test data. The test will take each file name as a parameter and run it individually.
35 @Parameterized.Parameters
36 fun downloadList() = listOf(
45 "tAJwqaWjJsXS8AhzSninBMCfIZbHBGgcc001lx5DIdDwIcfEgQ6vE5Gb5VgAled17DFZ2A7ZDOHA0NpQPHXXFt.svg",
49 // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/251028
52 fun allFilesAppearInDownloadsMenuTest() {
54 openPageAndDownloadFile(url = downloadTestPage.toUri(), downloadFile = downloadFile)
55 verifyDownloadCompleteNotificationPopup()
56 }.closeDownloadPrompt {
58 }.openDownloadsManager {
59 waitForDownloadsListToExist()
60 verifyDownloadedFileName(downloadFile)
61 verifyDownloadedFileIcon()
62 }.exitDownloadsManagerToBrowser { }