From 387c73580117542e6ab04006b6ab20b473f0f1db Mon Sep 17 00:00:00 2001 From: Allison Naaktgeboren Date: Wed, 19 Aug 2015 20:46:46 -0700 Subject: [PATCH] Bug 1174878 - Update robocop test testSettingsMenuItems.java to use StringHelper.java in all cases.r=liuche --- .../tests/browser/robocop/StringHelper.java | 108 ++++++++++++++++++ .../robocop/testSettingsMenuItems.java | 43 +++---- 2 files changed, 131 insertions(+), 20 deletions(-) diff --git a/mobile/android/tests/browser/robocop/StringHelper.java b/mobile/android/tests/browser/robocop/StringHelper.java index 0720fd5584c6..89f35a18cec9 100644 --- a/mobile/android/tests/browser/robocop/StringHelper.java +++ b/mobile/android/tests/browser/robocop/StringHelper.java @@ -114,6 +114,10 @@ public class StringHelper { public final String DISTRIBUTION1_LABEL = "Distribution 1"; public final String DISTRIBUTION2_LABEL = "Distribution 2"; + // Import strings + public final String BOOKMARKS; + public final String IMPORT; + // Settings menu strings // Section labels - ordered as found in the settings menu public final String CUSTOMIZE_SECTION_LABEL; @@ -154,6 +158,16 @@ public class StringHelper { public final String MANAGE_LOGINS_LABEL; public final String MASTER_PASSWORD_LABEL; public final String CLEAR_PRIVATE_DATA_LABEL; + public final String ENABLED_EXCLUDE_3RD_PARTY; + public final String BROWSING_HISTORY; + public final String SEARCH_HISTORY; + public final String DOWNLOADS; + public final String FORM_HISTORY; + public final String COOKIES_AND_LOGINS; + public final String CACHE; + public final String OFFLINE_DATA; + public final String SITE_SETTINGS; + public final String CLEAR_DATA_BUTTON; // Mozilla public final String BRAND_NAME = "(Fennec|Nightly|Aurora|Firefox Beta|Firefox)"; @@ -163,6 +177,15 @@ public class StringHelper { public final String LOCATION_SERVICES_LABEL = "Mozilla Location Service"; public final String HEALTH_REPORT_LABEL = BRAND_NAME + " Health Report"; public final String MY_HEALTH_REPORT_LABEL; + public final String DATA_CHOICES; + public final String HEALTH_REPORT_EXPLANATION; + public final String MOZ_LOCATION; + public final String MOZ_LOCATION_MSG; + public final String LEARN_MORE; + public final String CRASH_REPORTER; + public final String CRASH_REPORTER_MSG; + public final String TELEMETRY; + public final String TELEMETRY_MSG; // Developer tools public final String REMOTE_DEBUGGING_USB_LABEL; @@ -239,6 +262,37 @@ public class StringHelper { // Strings used as content description, e.g. for ImageButtons public final String CONTENT_DESCRIPTION_READER_MODE_BUTTON = "Enter Reader View"; + // Home Panel Settings + public final String CUSTOMIZE_HOME; + public final String ENABLED; + public final String HISTORY; + public final String PANELS; + + // Search Settings + public final String SEARCH_TITLE; + public final String SEARCH_SUGGESTIONS; + public final String SEARCH_INSTALLED; + + // Advanced Settings + public final String ADVANCED; + public final String DONT_SHOW_MENU; + public final String SHOW_MENU; + public final String DISABLED; + public final String TAP_TO_PLAY; + public final String HIDE_TITLE_BAR; + + // Update Settings + public final String AUTOMATIC_UPDATES; + public final String OVER_WIFI_OPTION; + public final String DOWNLOAD_UPDATES_AUTO; + public final String ALWAYS; + public final String NEVER; + + // Restore Tabs Settings + public final String DONT_RESTORE_TABS; + public final String ALWAYS_RESTORE_TABS; + public final String DONT_RESTORE_QUIT; + private StringHelper(final Resources res) { OK = res.getString(R.string.button_ok); @@ -306,6 +360,10 @@ public class StringHelper { TITLE_PLACE_HOLDER = res.getString(R.string.url_bar_default_text); + // Import strings + IMPORT = res.getString(R.string.bookmarkhistory_button_import); + BOOKMARKS = res.getString(R.string.bookmark); + // Settings menu strings // Section labels - ordered as found in the settings menu CUSTOMIZE_SECTION_LABEL = res.getString(R.string.pref_category_customize); @@ -341,11 +399,30 @@ public class StringHelper { MANAGE_LOGINS_LABEL = res.getString(R.string.pref_manage_logins); MASTER_PASSWORD_LABEL = res.getString(R.string.pref_use_master_password); CLEAR_PRIVATE_DATA_LABEL = res.getString(R.string.pref_clear_private_data); + ENABLED_EXCLUDE_3RD_PARTY = res.getString(R.string.pref_cookies_not_accept_foreign); + BROWSING_HISTORY = res.getString(R.string.pref_private_data_history2); + SEARCH_HISTORY = res.getString(R.string.pref_private_data_searchHistory); + DOWNLOADS = res.getString(R.string.pref_private_data_downloadFiles2); + FORM_HISTORY = res.getString(R.string.pref_private_data_formdata2); + COOKIES_AND_LOGINS = res.getString(R.string.pref_private_data_cookies2); + CACHE = res.getString(R.string.pref_private_data_cache); + OFFLINE_DATA = res.getString(R.string.pref_private_data_offlineApps); + SITE_SETTINGS = res.getString(R.string.pref_private_data_siteSettings); + CLEAR_DATA_BUTTON = res.getString(R.string.button_clear_data); // Mozilla FAQS_LABEL = res.getString(R.string.pref_vendor_faqs); FEEDBACK_LABEL = res.getString(R.string.pref_vendor_feedback); + DATA_CHOICES = res.getString(R.string.pref_category_datareporting); MY_HEALTH_REPORT_LABEL = res.getString(R.string.datareporting_abouthr_title); + HEALTH_REPORT_EXPLANATION = res.getString(R.string.datareporting_fhr_summary2); + MOZ_LOCATION = res.getString(R.string.datareporting_wifi_title); + MOZ_LOCATION_MSG = res.getString(R.string.datareporting_wifi_geolocation_summary); + LEARN_MORE = res.getString(R.string.pref_learn_more); + CRASH_REPORTER = res.getString(R.string.datareporting_crashreporter_title_short); + CRASH_REPORTER_MSG = res.getString(R.string.datareporting_crashreporter_summary); + TELEMETRY = res.getString(R.string.datareporting_telemetry_title); + TELEMETRY_MSG = res.getString(R.string.datareporting_telemetry_summary); // Developer tools REMOTE_DEBUGGING_USB_LABEL = res.getString(R.string.pref_developer_remotedebugging_usb); @@ -403,6 +480,37 @@ public class StringHelper { GEO_ALLOW = res.getString(R.string.share); POPUP_ALLOW = res.getString(R.string.pref_panels_show); + + // Home Settings + PANELS = res.getString(R.string.pref_category_home_panels); + CUSTOMIZE_HOME = res.getString(R.string.pref_category_home); + ENABLED = res.getString(R.string.pref_home_updates_enabled); + HISTORY = res.getString(R.string.home_history_title); + + // Search Settings + SEARCH_TITLE = res.getString(R.string.search); + SEARCH_SUGGESTIONS = res.getString(R.string.pref_search_suggestions); + SEARCH_INSTALLED = res.getString(R.string.pref_category_installed_search_engines); + + // Advanced Settings + ADVANCED = res.getString(R.string.pref_category_advanced); + DONT_SHOW_MENU = res.getString(R.string.pref_char_encoding_off); + SHOW_MENU = res.getString(R.string.pref_char_encoding_on); + DISABLED = res.getString(R.string.pref_plugins_disabled ); + TAP_TO_PLAY = res.getString(R.string.pref_plugins_tap_to_play); + HIDE_TITLE_BAR = res.getString(R.string.pref_scroll_title_bar_summary ); + + // Update Settings + AUTOMATIC_UPDATES = res.getString(R.string.pref_home_updates); + OVER_WIFI_OPTION = res.getString(R.string.pref_update_autodownload_wifi); + DOWNLOAD_UPDATES_AUTO = res.getString(R.string.pref_update_autodownload); + ALWAYS = res.getString(R.string.pref_update_autodownload_enabled); + NEVER = res.getString(R.string.pref_update_autodownload_disabled); + + // Restore Tabs Settings + DONT_RESTORE_TABS = res.getString(R.string.pref_restore_quit); + ALWAYS_RESTORE_TABS = res.getString(R.string.pref_restore_always); + DONT_RESTORE_QUIT = res.getString(R.string.pref_restore_quit); } public static void initialize(Resources res) { diff --git a/mobile/android/tests/browser/robocop/testSettingsMenuItems.java b/mobile/android/tests/browser/robocop/testSettingsMenuItems.java index 69dd4121e3f0..3d27e09dd995 100644 --- a/mobile/android/tests/browser/robocop/testSettingsMenuItems.java +++ b/mobile/android/tests/browser/robocop/testSettingsMenuItems.java @@ -69,16 +69,16 @@ public class testSettingsMenuItems extends PixelTest { PATH_CUSTOMIZE = new String[] { mStringHelper.CUSTOMIZE_SECTION_LABEL }; OPTIONS_CUSTOMIZE = new String[][] { - { "Home" }, - { "Search", "", "Show search suggestions", "Installed search engines"}, - { mStringHelper.TABS_LABEL, "Don't restore after quitting " + mStringHelper.BRAND_NAME, "Always restore", "Don't restore after quitting " + mStringHelper.BRAND_NAME }, - { mStringHelper.IMPORT_FROM_ANDROID_LABEL, "", "Bookmarks", "History", "Import" }, + { mStringHelper.CUSTOMIZE_HOME}, + { mStringHelper.SEARCH_TITLE, "", mStringHelper.SEARCH_SUGGESTIONS, mStringHelper.SEARCH_INSTALLED}, + { mStringHelper.TABS_LABEL, mStringHelper.DONT_RESTORE_TABS, mStringHelper.ALWAYS_RESTORE_TABS, mStringHelper.DONT_RESTORE_QUIT }, + { mStringHelper.IMPORT_FROM_ANDROID_LABEL, "", mStringHelper.BOOKMARKS, mStringHelper.HISTORY, mStringHelper.IMPORT }, }; - PATH_HOME = new String[] { mStringHelper.CUSTOMIZE_SECTION_LABEL, "Home" }; + PATH_HOME = new String[] { mStringHelper.CUSTOMIZE_SECTION_LABEL, mStringHelper.CUSTOMIZE_HOME }; OPTIONS_HOME = new String[][] { - { "Panels" }, - { "Automatic updates", "Enabled", "Enabled", "Only over Wi-Fi" }, + { mStringHelper.PANELS }, + { mStringHelper.AUTOMATIC_UPDATES, mStringHelper.ENABLED, mStringHelper.ENABLED, mStringHelper.OVER_WIFI_OPTION}, }; PATH_DISPLAY = new String[] { mStringHelper.DISPLAY_SECTION_LABEL }; @@ -87,21 +87,24 @@ public class testSettingsMenuItems extends PixelTest { OPTIONS_DISPLAY = new String[][] { { mStringHelper.TEXT_SIZE_LABEL }, TITLE_BAR_LABEL_ARR, - { mStringHelper.SCROLL_TITLE_BAR_LABEL, "Hide the " + mStringHelper.BRAND_NAME + " title bar when scrolling down a page" }, - { "Advanced" }, - { mStringHelper.CHARACTER_ENCODING_LABEL, "Don't show menu", "Show menu", "Don't show menu" }, - { mStringHelper.PLUGINS_LABEL, "Tap to play", "Enabled", "Tap to play", "Disabled" }, + { mStringHelper.SCROLL_TITLE_BAR_LABEL, mStringHelper.HIDE_TITLE_BAR }, + { mStringHelper.ADVANCED}, + { mStringHelper.CHARACTER_ENCODING_LABEL, mStringHelper.DONT_SHOW_MENU, mStringHelper.SHOW_MENU, mStringHelper.DONT_SHOW_MENU }, + { mStringHelper.PLUGINS_LABEL, mStringHelper.TAP_TO_PLAY, mStringHelper.ENABLED, mStringHelper.TAP_TO_PLAY, mStringHelper.DISABLED }, }; PATH_PRIVACY = new String[] { mStringHelper.PRIVACY_SECTION_LABEL }; OPTIONS_PRIVACY = new String[][] { { mStringHelper.TRACKING_PROTECTION_LABEL }, { mStringHelper.DNT_LABEL }, - { mStringHelper.COOKIES_LABEL, "Enabled", "Enabled, excluding 3rd party", "Disabled" }, + { mStringHelper.COOKIES_LABEL, mStringHelper.ENABLED, mStringHelper.ENABLED_EXCLUDE_3RD_PARTY, mStringHelper.ENABLED }, { mStringHelper.REMEMBER_LOGINS_LABEL }, { mStringHelper.MANAGE_LOGINS_LABEL }, { mStringHelper.MASTER_PASSWORD_LABEL }, - { mStringHelper.CLEAR_PRIVATE_DATA_LABEL, "", "Browsing history", "Search history", "Downloads", "Form history", "Cookies & active logins", mStringHelper.CLEAR_PRIVATE_DATA_LABEL, "Cache", "Offline website data", "Site settings", "Clear data" }, + { mStringHelper.CLEAR_PRIVATE_DATA_LABEL, "", mStringHelper.BROWSING_HISTORY, + mStringHelper.SEARCH_HISTORY, mStringHelper.DOWNLOADS, mStringHelper.FORM_HISTORY, + mStringHelper.COOKIES_AND_LOGINS, mStringHelper.CLEAR_PRIVATE_DATA_LABEL, mStringHelper.CACHE, + mStringHelper.OFFLINE_DATA, mStringHelper.SITE_SETTINGS, mStringHelper.CLEAR_DATA_BUTTON }, }; PATH_MOZILLA = new String[] { mStringHelper.MOZILLA_SECTION_LABEL }; @@ -109,8 +112,8 @@ public class testSettingsMenuItems extends PixelTest { { mStringHelper.ABOUT_LABEL }, { mStringHelper.FAQS_LABEL }, { mStringHelper.FEEDBACK_LABEL }, - { "Data choices" }, - { mStringHelper.HEALTH_REPORT_LABEL, "Shares data with Mozilla about your browser health and helps you understand your browser performance" }, + { mStringHelper.DATA_CHOICES }, + { mStringHelper.HEALTH_REPORT_LABEL, mStringHelper.HEALTH_REPORT_EXPLANATION }, { mStringHelper.MY_HEALTH_REPORT_LABEL }, }; @@ -184,17 +187,17 @@ public class testSettingsMenuItems extends PixelTest { if (AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED) { // Anonymous cell tower/wifi collection - String[] networkReportingUi = { "Mozilla Location Service", "Help Mozilla map the world! Share the approximate Wi-Fi and cellular location of your device to improve our geolocation service." }; + String[] networkReportingUi = { mStringHelper.MOZ_LOCATION, mStringHelper.MOZ_LOCATION_MSG }; settingsMap.get(PATH_MOZILLA).add(networkReportingUi); - String[] learnMoreUi = { "Learn more" }; + String[] learnMoreUi = { mStringHelper.LEARN_MORE }; settingsMap.get(PATH_MOZILLA).add(learnMoreUi); } } // Automatic updates if (AppConstants.MOZ_UPDATER) { - String[] autoUpdateUi = { "Download updates automatically", "Only over Wi-Fi", "Always", "Only over Wi-Fi", "Never" }; + String[] autoUpdateUi = { mStringHelper.DOWNLOAD_UPDATES_AUTO, mStringHelper.OVER_WIFI_OPTION, mStringHelper.ALWAYS, mStringHelper.OVER_WIFI_OPTION, mStringHelper.NEVER }; settingsMap.get(PATH_CUSTOMIZE).add(autoUpdateUi); } @@ -206,13 +209,13 @@ public class testSettingsMenuItems extends PixelTest { // Crash reporter if (AppConstants.MOZ_CRASHREPORTER) { - String[] crashReporterUi = { "Crash Reporter", mStringHelper.BRAND_NAME + " submits crash reports to help Mozilla make your browser more stable and secure" }; + String[] crashReporterUi = { mStringHelper.CRASH_REPORTER, mStringHelper.CRASH_REPORTER_MSG}; settingsMap.get(PATH_MOZILLA).add(crashReporterUi); } // Telemetry if (AppConstants.MOZ_TELEMETRY_REPORTING) { - String[] telemetryUi = { "Telemetry", "Shares performance, usage, hardware and customization data about your browser with Mozilla to help us make " + mStringHelper.BRAND_NAME + " better" }; + String[] telemetryUi = { mStringHelper.TELEMETRY, mStringHelper.TELEMETRY_MSG}; settingsMap.get(PATH_MOZILLA).add(telemetryUi); }