2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Bug 1829600 - New address not found error page UI test

This commit is contained in:
AndiAJ 2023-04-24 11:49:18 +03:00 committed by mergify[bot]
parent 250e8ef04e
commit 07bdcbc994
2 changed files with 22 additions and 0 deletions

View File

@ -11,10 +11,12 @@ import org.junit.Test
import org.mozilla.fenix.R
import org.mozilla.fenix.customannotations.SmokeTest
import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.MatcherHelper.itemWithResId
import org.mozilla.fenix.helpers.RetryTestRule
import org.mozilla.fenix.helpers.TestHelper.getStringResource
import org.mozilla.fenix.helpers.TestHelper.setNetworkEnabled
import org.mozilla.fenix.ui.robots.browserScreen
import org.mozilla.fenix.ui.robots.clickPageObject
import org.mozilla.fenix.ui.robots.navigationToolbar
/**
@ -112,4 +114,17 @@ class BrowsingErrorPagesTest {
verifyPageContent("Example Domain")
}
}
@Test
fun addressNotFoundErrorMessageTest() {
val url = "ww.example.com"
navigationToolbar {
}.enterURLAndEnterToBrowser(url.toUri()) {
waitForPageToLoad()
verifyAddressNotFoundErrorMessage()
clickPageObject(itemWithResId("errorTryAgain"))
verifyAddressNotFoundErrorMessage()
}
}
}

View File

@ -805,6 +805,13 @@ class BrowserRobot {
assertItemWithResIdExists(itemWithResId("errorTryAgain"))
}
fun verifyAddressNotFoundErrorMessage() {
assertItemContainingTextExists(
itemContainingText(getStringResource(R.string.mozac_browser_errorpages_unknown_host_title)),
)
assertItemWithResIdExists(itemWithResId("errorTryAgain"))
}
class Transition {
fun openThreeDotMenu(interact: ThreeDotMenuMainRobot.() -> Unit): ThreeDotMenuMainRobot.Transition {
mDevice.waitForIdle(waitingTime)