diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/BrowsingErrorPagesTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/BrowsingErrorPagesTest.kt index bdfa281d2d..a27fc185ba 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/BrowsingErrorPagesTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/BrowsingErrorPagesTest.kt @@ -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() + } + } } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt index 377d8ab5a2..78bd171781 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/BrowserRobot.kt @@ -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)