Skip to content
Snippets Groups Projects
Commit 39a422c9 authored by Mugurell's avatar Mugurell Committed by Richard Pospesel
Browse files

Bug 1812518 - Fix UI tests affected by the refactoring.

parent f66d9ac0
Branches
Tags
No related merge requests found
......@@ -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)
......
......
......@@ -75,7 +75,7 @@ class DownloadFileTypesTest(fileName: String) {
verifyDownloadPrompt(downloadFile)
}.clickDownload {
verifyDownloadNotificationPopup()
}.closePrompt {
}.closeCompletedDownloadPrompt {
}.openThreeDotMenu {
}.openDownloadsManager {
waitForDownloadsListToExist()
......
......
......@@ -105,7 +105,7 @@ class DownloadTest {
verifyDownloadPrompt(downloadFile)
}.clickDownload {
verifyDownloadNotificationPopup()
}.closePrompt { }
}
mDevice.openNotification()
notificationShade {
verifySystemNotificationExists("Download completed")
......
......
......@@ -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() =
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment