From c5eaad182a13f012b3b9f09df93cdc4b99d65d9e Mon Sep 17 00:00:00 2001 From: AndiAJ Date: Fri, 20 Oct 2023 14:38:01 +0300 Subject: [PATCH] Bug 1860262 - PWA TestRail matching --- .../org/mozilla/fenix/ui/ComposeSmokeTest.kt | 17 ---- .../java/org/mozilla/fenix/ui/PwaTest.kt | 79 +++---------------- .../java/org/mozilla/fenix/ui/SmokeTest.kt | 17 ---- 3 files changed, 9 insertions(+), 104 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/ComposeSmokeTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/ComposeSmokeTest.kt index 60423a419..532696b2c 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/ComposeSmokeTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/ComposeSmokeTest.kt @@ -8,7 +8,6 @@ package org.mozilla.fenix.ui import android.view.View import androidx.compose.ui.test.junit4.AndroidComposeTestRule -import androidx.core.net.toUri import androidx.test.platform.app.InstrumentationRegistry import androidx.test.rule.ActivityTestRule import androidx.test.uiautomator.UiDevice @@ -73,22 +72,6 @@ class ComposeSmokeTest { mockWebServer.shutdown() } - @Test - fun mainMenuInstallPWATest() { - val pwaPage = "https://mozilla-mobile.github.io/testapp/" - - navigationToolbar { - }.enterURLAndEnterToBrowser(pwaPage.toUri()) { - verifyNotificationDotOnMainMenu() - }.openThreeDotMenu { - }.clickInstall { - clickAddAutomaticallyButton() - }.openHomeScreenShortcut("TEST_APP") { - mDevice.waitForIdle() - verifyNavURLBarHidden() - } - } - // Verifies that reader mode is detected and the custom appearance controls are displayed @Test fun verifyReaderViewAppearanceUI() { diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/PwaTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/PwaTest.kt index 0b8cb35af..4ccfa4a97 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/PwaTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/PwaTest.kt @@ -5,27 +5,16 @@ package org.mozilla.fenix.ui import androidx.core.net.toUri -import org.junit.Ignore import org.junit.Rule import org.junit.Test -import org.mozilla.fenix.helpers.Constants.PackageName.GMAIL_APP -import org.mozilla.fenix.helpers.Constants.PackageName.PHONE_APP +import org.mozilla.fenix.customannotations.SmokeTest import org.mozilla.fenix.helpers.HomeActivityIntentTestRule import org.mozilla.fenix.helpers.MatcherHelper.itemContainingText -import org.mozilla.fenix.helpers.MatcherHelper.itemWithResId -import org.mozilla.fenix.helpers.MatcherHelper.itemWithResIdAndText -import org.mozilla.fenix.helpers.MatcherHelper.itemWithText -import org.mozilla.fenix.helpers.TestHelper -import org.mozilla.fenix.helpers.TestHelper.assertExternalAppOpens -import org.mozilla.fenix.helpers.TestHelper.assertNativeAppOpens import org.mozilla.fenix.helpers.TestHelper.mDevice -import org.mozilla.fenix.ui.robots.addToHomeScreen -import org.mozilla.fenix.ui.robots.browserScreen import org.mozilla.fenix.ui.robots.clickPageObject import org.mozilla.fenix.ui.robots.customTabScreen import org.mozilla.fenix.ui.robots.navigationToolbar import org.mozilla.fenix.ui.robots.pwaScreen -import org.mozilla.fenix.ui.robots.setPageObjectText class PwaTest { /* Updated externalLinks.html to v2.0, @@ -39,6 +28,7 @@ class PwaTest { @get:Rule val activityTestRule = HomeActivityIntentTestRule.withDefaultSettingsOverrides() + // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/845695 @Test fun externalLinkPWATest() { val externalLinkURL = "https://mozilla-mobile.github.io/testapp/downloads" @@ -59,38 +49,7 @@ class PwaTest { } } - @Test - fun emailLinkPWATest() { - navigationToolbar { - }.enterURLAndEnterToBrowser(externalLinksPWAPage.toUri()) { - waitForPageToLoad() - verifyNotificationDotOnMainMenu() - }.openThreeDotMenu { - }.clickInstall { - clickAddAutomaticallyButton() - }.openHomeScreenShortcut(shortcutTitle) { - clickPageObject(itemContainingText("Email link")) - clickPageObject(itemWithResIdAndText("android:id/button1", "OPEN")) - assertExternalAppOpens(GMAIL_APP) - } - } - - @Test - fun telephoneLinkPWATest() { - navigationToolbar { - }.enterURLAndEnterToBrowser(externalLinksPWAPage.toUri()) { - waitForPageToLoad() - verifyNotificationDotOnMainMenu() - }.openThreeDotMenu { - }.clickInstall { - clickAddAutomaticallyButton() - }.openHomeScreenShortcut(shortcutTitle) { - clickPageObject(itemContainingText("Telephone link")) - clickPageObject(itemWithResIdAndText("android:id/button1", "OPEN")) - assertNativeAppOpens(PHONE_APP, phoneLink) - } - } - + // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/845694 @Test fun appLikeExperiencePWATest() { navigationToolbar { @@ -109,11 +68,11 @@ class PwaTest { } } - @Ignore("Failing, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1807273") + // TestRail link: https://testrail.stage.mozaws.net/index.php?/cases/view/834200 + @SmokeTest @Test - fun saveLoginsInPWATest() { - val pwaPage = "https://mozilla-mobile.github.io/testapp/loginForm" - val shortcutTitle = "TEST_APP" + fun installPWAFromTheMainMenuTest() { + val pwaPage = "https://mozilla-mobile.github.io/testapp/" navigationToolbar { }.enterURLAndEnterToBrowser(pwaPage.toUri()) { @@ -121,29 +80,9 @@ class PwaTest { }.openThreeDotMenu { }.clickInstall { clickAddAutomaticallyButton() - }.openHomeScreenShortcut(shortcutTitle) { + }.openHomeScreenShortcut("TEST_APP") { mDevice.waitForIdle() - setPageObjectText(itemWithResId("username"), "mozilla") - setPageObjectText(itemWithResId("password"), "firefox") - clickPageObject(itemWithResId("submit")) - verifySaveLoginPromptIsDisplayed() - clickPageObject(itemWithText("Save")) - TestHelper.openAppFromExternalLink(pwaPage) - - browserScreen { - }.openThreeDotMenu { - }.openSettings { - }.openLoginsAndPasswordSubMenu { - }.openSavedLogins { - verifySecurityPromptForLogins() - tapSetupLater() - verifySavedLoginsSectionUsername("mozilla") - } - - addToHomeScreen { - }.searchAndOpenHomeScreenShortcut(shortcutTitle) { - verifyPrefilledPWALoginCredentials("mozilla", shortcutTitle) - } + verifyNavURLBarHidden() } } } diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt index ebfb8e3b0..241089cd6 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt @@ -8,7 +8,6 @@ package org.mozilla.fenix.ui import android.view.View import androidx.compose.ui.test.junit4.AndroidComposeTestRule -import androidx.core.net.toUri import androidx.test.platform.app.InstrumentationRegistry import androidx.test.rule.ActivityTestRule import androidx.test.uiautomator.UiDevice @@ -105,22 +104,6 @@ class SmokeTest { } } - @Test - fun mainMenuInstallPWATest() { - val pwaPage = "https://mozilla-mobile.github.io/testapp/" - - navigationToolbar { - }.enterURLAndEnterToBrowser(pwaPage.toUri()) { - verifyNotificationDotOnMainMenu() - }.openThreeDotMenu { - }.clickInstall { - clickAddAutomaticallyButton() - }.openHomeScreenShortcut("TEST_APP") { - mDevice.waitForIdle() - verifyNavURLBarHidden() - } - } - // Verifies that reader mode is detected and the custom appearance controls are displayed @Test fun verifyReaderViewAppearanceUI() {