Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…fix testDownloadCompleteNotification testDownloadPrompt and testCloseDownloadPrompt
  • Loading branch information
AndiAJ committed May 23, 2022
1 parent 672510f commit 41e5be4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ class DownloadTest {
}
}

@Ignore("Failing, see: https://github.com/mozilla-mobile/fenix/issues/25002")
@Test
fun testDownloadCompleteNotification() {
downloadFile = "smallZip.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,29 @@ fun downloadRobot(interact: DownloadRobot.() -> Unit): DownloadRobot.Transition
}

private fun assertDownloadPrompt(fileName: String) {
assertTrue(
"Download prompt button not visible",
mDevice.findObject(UiSelector().resourceId("$packageName:id/download_button"))
.waitForExists(waitingTime)
)
assertTrue(
"$fileName title doesn't match",
mDevice.findObject(UiSelector().text(fileName))
.waitForExists(waitingTime)
)
var currentTries = 0
while (currentTries++ < 3) {
try {
assertTrue(
"Download prompt button not visible",
mDevice.findObject(UiSelector().resourceId("$packageName:id/download_button"))
.waitForExists(waitingTime)
)
assertTrue(
"$fileName title doesn't match",
mDevice.findObject(UiSelector().text(fileName))
.waitForExists(waitingTime)
)

break
} catch (e: AssertionError) {
println("Failed to find locator: ${e.localizedMessage}")

browserScreen {
}.clickDownloadLink(fileName) {
}
}
}
}

private fun assertDownloadNotificationPopup() {
Expand Down

0 comments on commit 41e5be4

Please sign in to comment.