Bug 1807268 - Re-enable verifyShowClipboardSuggestionsToggleTest UI test r=jajohnson
[gecko.git] / mobile / android / fenix / app / src / androidTest / java / org / mozilla / fenix / ui / DownloadFileTypesTest.kt
blob1ff999f4280a83240addb17ec991f22fc02f67ee
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
8 import org.junit.Rule
9 import org.junit.Test
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
17 /**
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.
22  **/
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
29     @get:Rule
30     val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides()
32     companion object {
33         // Creating test data. The test will take each file name as a parameter and run it individually.
34         @JvmStatic
35         @Parameterized.Parameters
36         fun downloadList() = listOf(
37             "smallZip.zip",
38             "MyDocument.docx",
39             "audioSample.mp3",
40             "textfile.txt",
41             "web_icon.png",
42             "videoSample.webm",
43             "CSVfile.csv",
44             "XMLfile.xml",
45             "tAJwqaWjJsXS8AhzSninBMCfIZbHBGgcc001lx5DIdDwIcfEgQ6vE5Gb5VgAled17DFZ2A7ZDOHA0NpQPHXXFt.svg",
46         )
47     }
49     // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/251028
50     @SmokeTest
51     @Test
52     fun allFilesAppearInDownloadsMenuTest() {
53         downloadRobot {
54             openPageAndDownloadFile(url = downloadTestPage.toUri(), downloadFile = downloadFile)
55             verifyDownloadCompleteNotificationPopup()
56         }.closeDownloadPrompt {
57         }.openThreeDotMenu {
58         }.openDownloadsManager {
59             waitForDownloadsListToExist()
60             verifyDownloadedFileName(downloadFile)
61             verifyDownloadedFileIcon()
62         }.exitDownloadsManagerToBrowser { }
63     }