From d2abac78eb5ca860e086229c3c5f1649663e226e Mon Sep 17 00:00:00 2001 From: mcarare Date: Wed, 11 Dec 2019 17:14:39 +0200 Subject: [PATCH] For #7075 Update passwords preference visibility and string Set visibility for feature flags before settings screen it's displayed. Change string for preference to match existing header string. Update UI Tests --- .../java/org/mozilla/fenix/ui/robots/SettingsRobot.kt | 4 ++-- .../main/java/org/mozilla/fenix/settings/SettingsFragment.kt | 3 +-- app/src/main/res/xml/preferences.xml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt index 2e090eb84..e2badd4e5 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsRobot.kt @@ -156,8 +156,8 @@ private fun assertEnhancedTrackingProtectionValue() = onView(ViewMatchers.withTe .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) private fun assertLoginsButton() { - TestHelper.scrollToElementByText("Passwords") - onView(ViewMatchers.withText("Passwords")) + TestHelper.scrollToElementByText("Logins and passwords") + onView(ViewMatchers.withText("Logins and passwords")) .check(matches(withEffectiveVisibility(Visibility.VISIBLE))) } diff --git a/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt index 22973d372..1439db2bf 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt @@ -109,6 +109,7 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.preferences, rootKey) + updatePreferenceVisibilityForFeatureFlags() } override fun onResume() { @@ -167,8 +168,6 @@ class SettingsFragment : PreferenceFragmentCompat(), AccountObserver { context!!, requireComponents.backgroundServices.accountManager.accountProfile() ) - - updatePreferenceVisibilityForFeatureFlags() } private fun updatePreferenceVisibilityForFeatureFlags() { diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 35a1f3242..f6a10f6d0 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -67,7 +67,7 @@ app:isPreferenceVisible="false" android:icon="@drawable/ic_login" android:key="@string/pref_key_passwords" - android:title="@string/preferences_passwords" /> + android:title="@string/preferences_passwords_logins_and_passwords" />