For #27405 - Clean up references to "Sing in to Sync" phrase

This commit is contained in:
Alexandru2909 2022-10-17 16:28:54 +03:00 committed by mergify[bot]
parent 8fa81d4cd2
commit 2b2f3a711e
7 changed files with 16 additions and 18 deletions

View File

@ -101,7 +101,7 @@ class BookmarksTest {
verifyFolderTitle("Bookmarks Menu") verifyFolderTitle("Bookmarks Menu")
verifyFolderTitle("Bookmarks Toolbar") verifyFolderTitle("Bookmarks Toolbar")
verifyFolderTitle("Other Bookmarks") verifyFolderTitle("Other Bookmarks")
verifySignInToSyncButton() verifySyncSignInButton()
} }
}.clickSingInToSyncButton { }.clickSingInToSyncButton {
verifyTurnOnSyncToolbarTitle() verifyTurnOnSyncToolbarTitle()

View File

@ -138,8 +138,8 @@ class BookmarksRobot {
mDevice.waitNotNull(Until.findObject(By.text(childFolderName)), waitingTime) mDevice.waitNotNull(Until.findObject(By.text(childFolderName)), waitingTime)
} }
fun verifySignInToSyncButton() = fun verifySyncSignInButton() =
signInToSyncButton().check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))) syncSignInButton().check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)))
fun verifyDeleteFolderConfirmationMessage() = assertDeleteFolderConfirmationMessage() fun verifyDeleteFolderConfirmationMessage() = assertDeleteFolderConfirmationMessage()
@ -244,7 +244,7 @@ class BookmarksRobot {
} }
fun clickSingInToSyncButton(interact: SettingsTurnOnSyncRobot.() -> Unit): SettingsTurnOnSyncRobot.Transition { fun clickSingInToSyncButton(interact: SettingsTurnOnSyncRobot.() -> Unit): SettingsTurnOnSyncRobot.Transition {
signInToSyncButton().click() syncSignInButton().click()
SettingsTurnOnSyncRobot().interact() SettingsTurnOnSyncRobot().interact()
return SettingsTurnOnSyncRobot.Transition() return SettingsTurnOnSyncRobot.Transition()
@ -308,7 +308,7 @@ private fun saveBookmarkButton() = onView(withId(R.id.save_bookmark_button))
private fun deleteInEditModeButton() = onView(withId(R.id.delete_bookmark_button)) private fun deleteInEditModeButton() = onView(withId(R.id.delete_bookmark_button))
private fun signInToSyncButton() = onView(withId(R.id.bookmark_folders_sign_in)) private fun syncSignInButton() = onView(withId(R.id.bookmark_folders_sign_in))
private fun assertBookmarksView() { private fun assertBookmarksView() {
onView( onView(

View File

@ -50,7 +50,7 @@ class ThreeDotMenuMainRobot {
fun verifyAddOnsButton() = assertAddOnsButton() fun verifyAddOnsButton() = assertAddOnsButton()
fun verifyHistoryButton() = assertHistoryButton() fun verifyHistoryButton() = assertHistoryButton()
fun verifyBookmarksButton() = assertBookmarksButton() fun verifyBookmarksButton() = assertBookmarksButton()
fun verifySyncSignInButton() = assertSignInToSyncButton() fun verifySyncSignInButton() = assertSyncSignInButton()
fun verifyHelpButton() = assertHelpButton() fun verifyHelpButton() = assertHelpButton()
fun verifyThreeDotMenuExists() = threeDotMenuRecyclerViewExists() fun verifyThreeDotMenuExists() = threeDotMenuRecyclerViewExists()
fun verifyForwardButton() = assertForwardButton() fun verifyForwardButton() = assertForwardButton()
@ -77,7 +77,6 @@ class ThreeDotMenuMainRobot {
fun verifyDesktopSite() = assertDesktopSite() fun verifyDesktopSite() = assertDesktopSite()
fun verifyDownloadsButton() = assertDownloadsButton() fun verifyDownloadsButton() = assertDownloadsButton()
fun verifyShareTabsOverlay() = assertShareTabsOverlay() fun verifyShareTabsOverlay() = assertShareTabsOverlay()
fun verifySignInToSyncButton() = assertSignInToSyncButton()
fun verifyNewTabButton() = assertNormalBrowsingNewTabButton() fun verifyNewTabButton() = assertNormalBrowsingNewTabButton()
fun verifyReportSiteIssueButton() = assertReportSiteIssueButton() fun verifyReportSiteIssueButton() = assertReportSiteIssueButton()
@ -97,7 +96,7 @@ class ThreeDotMenuMainRobot {
verifyHistoryButton() verifyHistoryButton()
verifyDownloadsButton() verifyDownloadsButton()
verifyAddOnsButton() verifyAddOnsButton()
verifySignInToSyncButton() verifySyncSignInButton()
threeDotMenuRecyclerView().perform(swipeUp()) threeDotMenuRecyclerView().perform(swipeUp())
verifyFindInPageButton() verifyFindInPageButton()
verifyDesktopSite() verifyDesktopSite()
@ -174,7 +173,7 @@ class ThreeDotMenuMainRobot {
fun openSyncSignIn(interact: SyncSignInRobot.() -> Unit): SyncSignInRobot.Transition { fun openSyncSignIn(interact: SyncSignInRobot.() -> Unit): SyncSignInRobot.Transition {
threeDotMenuRecyclerView().perform(swipeDown()) threeDotMenuRecyclerView().perform(swipeDown())
mDevice.waitNotNull(Until.findObject(By.text("Sync and save data")), waitingTime) mDevice.waitNotNull(Until.findObject(By.text("Sync and save data")), waitingTime)
signInToSyncButton().click() syncSignInButton().click()
SyncSignInRobot().interact() SyncSignInRobot().interact()
return SyncSignInRobot.Transition() return SyncSignInRobot.Transition()
@ -440,8 +439,8 @@ private fun bookmarksButton() = onView(allOf(withText(R.string.library_bookmarks
private fun assertBookmarksButton() = bookmarksButton() private fun assertBookmarksButton() = bookmarksButton()
.check(matches(withEffectiveVisibility(Visibility.VISIBLE))) .check(matches(withEffectiveVisibility(Visibility.VISIBLE)))
private fun signInToSyncButton() = onView(withText("Sync and save data")) private fun syncSignInButton() = onView(withText("Sync and save data"))
private fun assertSignInToSyncButton() = signInToSyncButton().check(matches(isDisplayed())) private fun assertSyncSignInButton() = syncSignInButton().check(matches(isDisplayed()))
private fun helpButton() = onView(allOf(withText(R.string.browser_menu_help))) private fun helpButton() = onView(allOf(withText(R.string.browser_menu_help)))
private fun assertHelpButton() = helpButton() private fun assertHelpButton() = helpButton()

View File

@ -26,8 +26,7 @@ import mozilla.components.service.fxa.manager.SyncEnginesStorage
* @param syncEngine The sync engine that will be used for the sync status lookup. * @param syncEngine The sync engine that will be used for the sync status lookup.
* @param loggedOffTitle Text label for the setting when user is not logged in. * @param loggedOffTitle Text label for the setting when user is not logged in.
* @param loggedInTitle Text label for the setting when user is logged in. * @param loggedInTitle Text label for the setting when user is logged in.
* @param onSignInToSyncClicked A callback executed when the [syncPreference] is clicked with a * @param onSyncSignInClicked A callback executed when the sync sign in [syncPreference] is clicked.
* preference status of "Sign in to Sync".
* @param onReconnectClicked A callback executed when the [syncPreference] is clicked with a * @param onReconnectClicked A callback executed when the [syncPreference] is clicked with a
* preference status of "Reconnect". * preference status of "Reconnect".
*/ */
@ -39,7 +38,7 @@ class SyncPreferenceView(
private val syncEngine: SyncEngine, private val syncEngine: SyncEngine,
private val loggedOffTitle: String, private val loggedOffTitle: String,
private val loggedInTitle: String, private val loggedInTitle: String,
private val onSignInToSyncClicked: () -> Unit = {}, private val onSyncSignInClicked: () -> Unit = {},
private val onReconnectClicked: () -> Unit = {}, private val onReconnectClicked: () -> Unit = {},
) { ) {
@ -102,7 +101,7 @@ class SyncPreferenceView(
title = loggedOffTitle title = loggedOffTitle
setOnPreferenceChangeListener { _, _ -> setOnPreferenceChangeListener { _, _ ->
onSignInToSyncClicked() onSyncSignInClicked()
false false
} }
} }

View File

@ -162,7 +162,7 @@ class AutofillSettingFragment : BiometricPromptPreferenceFragment() {
.getString(R.string.preferences_credit_cards_sync_cards_across_devices), .getString(R.string.preferences_credit_cards_sync_cards_across_devices),
loggedInTitle = requireContext() loggedInTitle = requireContext()
.getString(R.string.preferences_credit_cards_sync_cards), .getString(R.string.preferences_credit_cards_sync_cards),
onSignInToSyncClicked = { onSyncSignInClicked = {
findNavController().navigate( findNavController().navigate(
NavGraphDirections.actionGlobalTurnOnSync(), NavGraphDirections.actionGlobalTurnOnSync(),
) )

View File

@ -146,7 +146,7 @@ class SavedLoginsAuthFragment : PreferenceFragmentCompat() {
.getString(R.string.preferences_passwords_sync_logins_across_devices), .getString(R.string.preferences_passwords_sync_logins_across_devices),
loggedInTitle = requireContext() loggedInTitle = requireContext()
.getString(R.string.preferences_passwords_sync_logins), .getString(R.string.preferences_passwords_sync_logins),
onSignInToSyncClicked = { onSyncSignInClicked = {
val directions = val directions =
SavedLoginsAuthFragmentDirections.actionSavedLoginsAuthFragmentToTurnOnSyncFragment() SavedLoginsAuthFragmentDirections.actionSavedLoginsAuthFragmentToTurnOnSyncFragment()
findNavController().navigate(directions) findNavController().navigate(directions)

View File

@ -182,7 +182,7 @@ class SyncPreferenceViewTest {
syncEngine = SyncEngine.Passwords, syncEngine = SyncEngine.Passwords,
loggedOffTitle = notLoggedInTitle, loggedOffTitle = notLoggedInTitle,
loggedInTitle = loggedInTitle, loggedInTitle = loggedInTitle,
onSignInToSyncClicked = { onSyncSignInClicked = {
val directions = val directions =
SavedLoginsAuthFragmentDirections.actionSavedLoginsAuthFragmentToTurnOnSyncFragment() SavedLoginsAuthFragmentDirections.actionSavedLoginsAuthFragmentToTurnOnSyncFragment()
navController.navigate(directions) navController.navigate(directions)