Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into fix-search-terms-awesomebar
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Sep 28, 2021
2 parents a035a01 + 06292ac commit 6783d9b
Show file tree
Hide file tree
Showing 62 changed files with 2,608 additions and 305 deletions.
21 changes: 14 additions & 7 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4195,13 +4195,14 @@ perf.awesomebar:
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21315#issuecomment-920848442
data_sensitivity:
- technical
- interaction
notification_emails:
- android-probes@mozilla.com
- gkruglov@mozilla.com
expires: "2021-11-15"
expires: "2022-11-15"
bookmark_suggestions:
send_in_pings:
- metrics
Expand All @@ -4214,13 +4215,14 @@ perf.awesomebar:
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21315#issuecomment-920848442
data_sensitivity:
- technical
- interaction
notification_emails:
- android-probes@mozilla.com
- gkruglov@mozilla.com
expires: "2021-11-15"
expires: "2022-11-15"
search_engine_suggestions:
send_in_pings:
- metrics
Expand All @@ -4233,13 +4235,14 @@ perf.awesomebar:
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21315#issuecomment-920848442
data_sensitivity:
- technical
- interaction
notification_emails:
- android-probes@mozilla.com
- gkruglov@mozilla.com
expires: "2021-11-15"
expires: "2022-11-15"
session_suggestions:
send_in_pings:
- metrics
Expand All @@ -4252,13 +4255,14 @@ perf.awesomebar:
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21315#issuecomment-920848442
data_sensitivity:
- technical
- interaction
notification_emails:
- android-probes@mozilla.com
- gkruglov@mozilla.com
expires: "2021-11-15"
expires: "2022-11-15"
synced_tabs_suggestions:
send_in_pings:
- metrics
Expand All @@ -4271,13 +4275,14 @@ perf.awesomebar:
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21315#issuecomment-920848442
data_sensitivity:
- technical
- interaction
notification_emails:
- android-probes@mozilla.com
- gkruglov@mozilla.com
expires: "2021-11-15"
expires: "2022-11-15"
clipboard_suggestions:
send_in_pings:
- metrics
Expand All @@ -4290,13 +4295,14 @@ perf.awesomebar:
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21315#issuecomment-920848442
data_sensitivity:
- technical
- interaction
notification_emails:
- android-probes@mozilla.com
- gkruglov@mozilla.com
expires: "2021-11-15"
expires: "2022-11-15"
shortcuts_suggestions:
send_in_pings:
- metrics
Expand All @@ -4309,13 +4315,14 @@ perf.awesomebar:
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21315#issuecomment-920848442
data_sensitivity:
- technical
- interaction
notification_emails:
- android-probes@mozilla.com
- gkruglov@mozilla.com
expires: "2021-11-15"
expires: "2022-11-15"

autoplay:
visited_setting:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiObject
import androidx.test.uiautomator.UiScrollable
import androidx.test.uiautomator.UiSelector
import androidx.test.uiautomator.Until
import kotlinx.coroutines.runBlocking
import mozilla.components.support.ktx.android.content.appName
import org.hamcrest.CoreMatchers
import org.hamcrest.CoreMatchers.allOf
import org.junit.Assert
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.ext.waitNotNull
Expand Down Expand Up @@ -224,4 +226,9 @@ object TestHelper {
!urlBar.waitForExists(waitingTime)
)
}

fun UiDevice.waitForObjects(obj: UiObject, waitingTime: Long = TestAssetHelper.waitingTime) {
this.waitForIdle()
Assert.assertNotNull(obj.waitForExists(waitingTime))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.bookmarkStorage
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.RecyclerViewIdlingResource
Expand Down Expand Up @@ -344,6 +345,8 @@ class BookmarksTest {

@Test
fun openSelectionInNewTabTest() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)

browserScreen {
Expand Down
11 changes: 11 additions & 0 deletions app/src/androidTest/java/org/mozilla/fenix/ui/CollectionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
Expand Down Expand Up @@ -52,6 +53,8 @@ class CollectionTest {
@Test
// open a webpage, and add currently opened tab to existing collection
fun mainMenuSaveToExistingCollection() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
val firstWebPage = getGenericAsset(mockWebServer, 1)
val secondWebPage = getGenericAsset(mockWebServer, 2)

Expand All @@ -78,6 +81,8 @@ class CollectionTest {

@Test
fun verifyAddTabButtonOfCollectionMenu() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
val firstWebPage = getGenericAsset(mockWebServer, 1)
val secondWebPage = getGenericAsset(mockWebServer, 2)

Expand All @@ -104,6 +109,8 @@ class CollectionTest {

@Test
fun renameCollectionTest() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
val webPage = getGenericAsset(mockWebServer, 1)

navigationToolbar {
Expand All @@ -125,6 +132,8 @@ class CollectionTest {

@Test
fun createSecondCollectionTest() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
val webPage = getGenericAsset(mockWebServer, 1)

navigationToolbar {
Expand Down Expand Up @@ -204,6 +213,8 @@ class CollectionTest {

@Test
fun selectTabOnLongTapTest() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
val firstWebPage = getGenericAsset(mockWebServer, 1)
val secondWebPage = getGenericAsset(mockWebServer, 2)

Expand Down
4 changes: 4 additions & 0 deletions app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package org.mozilla.fenix.ui
import android.content.Context
import androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu
import androidx.test.espresso.IdlingRegistry
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.runBlocking
import mozilla.components.browser.storage.sync.PlacesHistoryStorage
import okhttp3.mockwebserver.MockWebServer
Expand All @@ -15,6 +16,7 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.RecyclerViewIdlingResource
Expand Down Expand Up @@ -219,6 +221,8 @@ class HistoryTest {
fun deleteMultipleSelectionTest() {
val firstWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)
val secondWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 2)
val settings = InstrumentationRegistry.getInstrumentation().targetContext.settings()
settings.hasShownHomeOnboardingDialog = true

navigationToolbar {
}.enterURLAndEnterToBrowser(firstWebPage.url) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.ext.waitNotNull
Expand Down Expand Up @@ -117,6 +118,8 @@ class HomeScreenTest {

@Test
fun dismissOnboardingUsingHelpTest() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
homeScreen {
verifyWelcomeHeader()
}.openThreeDotMenu {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
package org.mozilla.fenix.ui

import androidx.core.net.toUri
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.After
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.HomeActivityTestRule
import org.mozilla.fenix.helpers.TestHelper.packageName
import org.mozilla.fenix.helpers.TestHelper.setNetworkEnabled
Expand Down Expand Up @@ -53,6 +55,8 @@ class NoNetworkAccessStartupTests {
// Based on STR from https://github.com/mozilla-mobile/fenix/issues/16886
fun networkInterruptedFromBrowserToHomeTest() {
val url = "example.com"
val settings = InstrumentationRegistry.getInstrumentation().targetContext.settings()
settings.hasShownHomeOnboardingDialog = true

activityTestRule.launchActivity(null)

Expand Down
3 changes: 1 addition & 2 deletions app/src/androidTest/java/org/mozilla/fenix/ui/SearchTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class SearchTest {
}
}

@Ignore("Currently failing at assertSearchEngineResults, will need a re-check")
@Test
fun shortcutButtonTest() {
homeScreen {
Expand All @@ -63,7 +62,7 @@ class SearchTest {
}.goBack {
}.goBack {
}.openSearch {
// verifySearchWithText()
verifySearchBarEmpty()
clickSearchEngineButton(activityTestRule, "DuckDuckGo")
typeSearch("mozilla")
verifySearchEngineResults(activityTestRule, "DuckDuckGo", 4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.junit.Rule
import org.junit.Before
import org.junit.After
import org.junit.Test
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
import org.mozilla.fenix.ui.robots.clickRateButtonGooglePlay
Expand Down Expand Up @@ -75,6 +76,8 @@ class SettingsAboutTest {

@Test
fun verifyAboutFirefoxPreview() {
val settings = activityIntentTestRule.activity.settings()
settings.hasShownHomeOnboardingDialog = true
homeScreen {
}.openThreeDotMenu {
}.openSettings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.FenixApplication
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
import org.mozilla.fenix.helpers.TestAssetHelper.getGenericAsset
Expand Down Expand Up @@ -155,6 +156,8 @@ class SettingsBasicsTest {
// Goes through the settings and changes the default text on a webpage, then verifies if the text has changed.
val fenixApp = activityIntentTestRule.activity.applicationContext as FenixApplication
val webpage = getLoremIpsumAsset(mockWebServer).url
val settings = fenixApp.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true

// This value will represent the text size percentage the webpage will scale to. The default value is 100%.
val textSizePercentage = 180
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
import org.mozilla.fenix.helpers.TestAssetHelper
Expand Down Expand Up @@ -218,6 +219,8 @@ class SettingsPrivacyTest {
@Test
fun neverSaveLoginFromPromptTest() {
val saveLoginTest = TestAssetHelper.getSaveLoginAsset(mockWebServer)
val settings = activityTestRule.activity.settings()
settings.hasShownHomeOnboardingDialog = true

navigationToolbar {
}.enterURLAndEnterToBrowser(saveLoginTest.url) {
Expand Down Expand Up @@ -327,6 +330,8 @@ class SettingsPrivacyTest {

@Test
fun launchLinksInPrivateToggleOffStateDoesntChangeTest() {
val settings = activityTestRule.activity.applicationContext.settings()
settings.hasShownHomeOnboardingDialog = true
val defaultWebPage = TestAssetHelper.getGenericAsset(mockWebServer, 1)

setOpenLinksInPrivateOn()
Expand Down
Loading

0 comments on commit 6783d9b

Please sign in to comment.