Fix UI tests: SettingsPrivacyTest, DeepLinkTest.

upstream-sync
Sebastian Kaspari 3 years ago committed by mergify[bot]
parent 7fed8b4ab5
commit 1cc4ae9ab2

@ -108,7 +108,7 @@ class DeepLinkTest {
fun openSettingsLogins() {
robot.openSettingsLogins {
verifyDefaultView()
verifyDefaultValueAutofillLogins()
verifyDefaultValueAutofillLogins(InstrumentationRegistry.getInstrumentation().targetContext)
}
}

@ -176,7 +176,7 @@ class SettingsPrivacyTest {
TestHelper.scrollToElementByText("Logins and passwords")
}.openLoginsAndPasswordSubMenu {
verifyDefaultView()
verifyDefaultValueAutofillLogins()
verifyDefaultValueAutofillLogins(InstrumentationRegistry.getInstrumentation().targetContext)
verifyDefaultValueExceptions()
}.openSavedLogins {
verifySecurityPromptForLogins()

@ -6,6 +6,7 @@
package org.mozilla.fenix.ui.robots
import android.content.Context
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions.matches
@ -16,6 +17,7 @@ import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
import org.hamcrest.CoreMatchers
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.TestAssetHelper
import org.mozilla.fenix.helpers.click
import org.mozilla.fenix.helpers.ext.waitNotNull
@ -40,7 +42,7 @@ class SettingsSubMenuLoginsAndPasswordRobot {
fun verifyDefaultValueExceptions() = assertDefaultValueExceptions()
fun verifyDefaultValueAutofillLogins() = assertDefaultValueAutofillLogins()
fun verifyDefaultValueAutofillLogins(context: Context) = assertDefaultValueAutofillLogins(context)
class Transition {
val mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@ -97,7 +99,14 @@ private fun goBackButton() =
private fun assertDefaultView() = onView(ViewMatchers.withText("Sync logins across devices"))
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertDefaultValueAutofillLogins() = onView(ViewMatchers.withText("Autofill websites"))
private fun assertDefaultValueAutofillLogins(context: Context) = onView(
ViewMatchers.withText(
context.getString(
R.string.preferences_passwords_autofill2,
context.getString(R.string.app_name)
)
)
)
.check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
private fun assertDefaultValueExceptions() = onView(ViewMatchers.withText("Exceptions"))

@ -58,7 +58,7 @@ object FeatureFlags {
* Identifies and separates the tabs list with a secondary section containing least used tabs.
*/
val inactiveTabs = Config.channel.isNightlyOrDebug
/**
* Enables support for Android Autofill.
*

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- App name for private browsing mode. The first parameter is the name of the app defined in app_name (for example: Fenix)-->
<string name="app_name_private_5">Private %s</string>
<!-- App name for private browsing mode. The first parameter is the name of the app defined in app_name (for example: Fenix)-->
@ -1456,7 +1456,7 @@
<!-- Preference option for never saving passwords in Fenix -->
<string name="preferences_passwords_save_logins_never_save">Never save</string>
<!-- Preference for autofilling saved logins in Fenix -->
<string name="preferences_passwords_autofill">Autofill</string>
<string name="preferences_passwords_autofill" tools:ignore="UnusedResources">Autofill</string>
<!-- Preference for autofilling saved logins in Firefox (in web content), %1$s will be replaced with the app name -->
<string name="preferences_passwords_autofill2">Autofill in %1$s</string>
<!-- Description for the preference for autofilling saved logins in Firefox (in web content), %1$s will be replaced with the app name -->

Loading…
Cancel
Save