Exhaustive file-by-file audit of every Swift file in the project (iOS app, Watch app, Widget extension). Every interactive UI element — buttons, toggles, pickers, links, menus, tap gestures, text editors, color pickers, photo pickers — now has an accessibilityIdentifier for XCUITest automation. 46 files changed across Shared/, Onboarding/, Watch App/, and Widget targets. Added ~100 new ID definitions covering settings debug controls, export/photo views, sharing templates, customization subviews, onboarding flows, tip modals, widget voting buttons, and watch mood buttons.
494 lines
20 KiB
Swift
494 lines
20 KiB
Swift
//
|
|
// AccessibilityIdentifiers.swift
|
|
// Reflect (iOS)
|
|
//
|
|
// Centralized accessibility identifiers for XCUITest targeting.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum AccessibilityID {
|
|
// MARK: - Tabs
|
|
enum Tab {
|
|
static let day = "tab_day"
|
|
static let month = "tab_month"
|
|
static let year = "tab_year"
|
|
static let insights = "tab_insights"
|
|
static let settings = "tab_settings"
|
|
}
|
|
|
|
// MARK: - Mood Buttons (voting header)
|
|
enum MoodButton {
|
|
static let great = "mood_button_great"
|
|
static let good = "mood_button_good"
|
|
static let average = "mood_button_average"
|
|
static let bad = "mood_button_bad"
|
|
static let horrible = "mood_button_horrible"
|
|
|
|
static func id(for moodStrValue: String) -> String {
|
|
"mood_button_\(moodStrValue.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - Day View
|
|
enum DayView {
|
|
static let moodHeader = "mood_header"
|
|
static let entryList = "entry_list"
|
|
static let emptyState = "empty_state"
|
|
static let emptyStateNoData = "empty_state_no_data"
|
|
static func entryRow(dateString: String) -> String {
|
|
"entry_row_\(dateString)"
|
|
}
|
|
}
|
|
|
|
// MARK: - Entry Detail
|
|
enum EntryDetail {
|
|
static let sheet = "entry_detail_sheet"
|
|
static let doneButton = "entry_detail_done"
|
|
static let deleteButton = "entry_detail_delete"
|
|
static let noteButton = "entry_detail_note_button"
|
|
static let noteArea = "entry_detail_note_area"
|
|
static let moodGrid = "entry_detail_mood_grid"
|
|
static let reflectionBeginButton = "entry_detail_reflection_begin"
|
|
static let reflectionCard = "entry_detail_reflection_card"
|
|
static let photoButton = "entry_detail_photo_button"
|
|
static let photoPlaceholder = "entry_detail_photo_placeholder"
|
|
static let photoImage = "entry_detail_photo_image"
|
|
static let photoTakeButton = "entry_detail_photo_take"
|
|
static let photoChooseButton = "entry_detail_photo_choose"
|
|
static let photoRemoveButton = "entry_detail_photo_remove"
|
|
static let photoCancelButton = "entry_detail_photo_cancel"
|
|
static let deleteConfirmButton = "entry_detail_delete_confirm"
|
|
static let deleteCancelButton = "entry_detail_delete_cancel"
|
|
}
|
|
|
|
// MARK: - Note Editor
|
|
enum NoteEditor {
|
|
static let textEditor = "note_editor_text"
|
|
static let saveButton = "note_editor_save"
|
|
static let cancelButton = "note_editor_cancel"
|
|
static let keyboardDoneButton = "note_editor_keyboard_done"
|
|
}
|
|
|
|
// MARK: - Guided Reflection
|
|
enum GuidedReflection {
|
|
static let sheet = "guided_reflection_sheet"
|
|
static let progressDots = "guided_reflection_progress"
|
|
static let textEditor = "guided_reflection_text_editor"
|
|
static let nextButton = "guided_reflection_next"
|
|
static let backButton = "guided_reflection_back"
|
|
static let saveButton = "guided_reflection_save"
|
|
static let cancelButton = "guided_reflection_cancel"
|
|
static let infoButton = "guided_reflection_info"
|
|
static let discardButton = "guided_reflection_discard"
|
|
static let keepEditingButton = "guided_reflection_keep_editing"
|
|
static func questionLabel(step: Int) -> String {
|
|
"guided_reflection_question_\(step)"
|
|
}
|
|
static let chipGrid = "guided_reflection_chip_grid"
|
|
static let chipMoreButton = "guided_reflection_chip_more"
|
|
static func chip(label: String) -> String {
|
|
"guided_reflection_chip_\(label)"
|
|
}
|
|
// Info view
|
|
static let infoDoneButton = "guided_reflection_info_done"
|
|
static let cbtLearnMoreLink = "guided_reflection_cbt_learn_more"
|
|
static let actLearnMoreLink = "guided_reflection_act_learn_more"
|
|
static let baLearnMoreLink = "guided_reflection_ba_learn_more"
|
|
}
|
|
|
|
// MARK: - Settings
|
|
enum Settings {
|
|
static let header = "settings_header"
|
|
static let segmentedPicker = "settings_segmented_picker"
|
|
static let customizeTab = "settings_tab_customize"
|
|
static let settingsTab = "settings_tab_settings"
|
|
static let upgradeBanner = "upgrade_banner"
|
|
static let subscribeButton = "subscribe_button"
|
|
static let whyUpgradeButton = "why_upgrade_button"
|
|
static let clearDataButton = "settings_clear_data"
|
|
static let analyticsToggle = "settings_analytics_toggle"
|
|
static let showOnboardingButton = "settings_show_onboarding"
|
|
static let bypassSubscriptionToggle = "settings_bypass_subscription"
|
|
static let eulaButton = "settings_eula"
|
|
static let privacyPolicyButton = "settings_privacy_policy"
|
|
static let hapticFeedbackToggle = "settings_haptic_feedback_toggle"
|
|
static let deleteToggle = "settings_delete_toggle"
|
|
static let privacyLockToggle = "settings_privacy_lock_toggle"
|
|
static let healthSyncToggle = "settings_health_sync_toggle"
|
|
static let weatherToggle = "settings_weather_toggle"
|
|
static let reminderTimePicker = "settings_reminder_time_picker"
|
|
static let reminderSaveButton = "settings_reminder_save"
|
|
static let reminderCancelButton = "settings_reminder_cancel"
|
|
static let reminderTimeButton = "settings_reminder_time"
|
|
static let changeTrialDateButton = "settings_change_trial_date"
|
|
static let trialDatePickerDoneButton = "settings_trial_date_done"
|
|
static let trialDatePicker = "settings_trial_date_picker"
|
|
static let paywallPreviewButton = "settings_paywall_preview"
|
|
static let tipsPreviewButton = "settings_tips_preview"
|
|
static let testNotificationsButton = "settings_test_notifications"
|
|
static let exportWidgetsButton = "settings_export_widgets"
|
|
static let exportVotingLayoutsButton = "settings_export_voting_layouts"
|
|
static let exportWatchViewsButton = "settings_export_watch_views"
|
|
static let exportInsightsButton = "settings_export_insights"
|
|
static let generateScreenshotsButton = "settings_generate_screenshots"
|
|
static let addTestDataButton = "settings_add_test_data"
|
|
static let deleteHealthKitButton = "settings_delete_health_kit"
|
|
static let locationAlertOpenSettingsButton = "settings_location_open_settings"
|
|
static let locationAlertCancelButton = "settings_location_cancel"
|
|
static let fontAwesomeLink = "settings_font_awesome_link"
|
|
static let chartsLink = "settings_charts_link"
|
|
static let exportDataButton = "settings_export_data"
|
|
static let closeButton = "settings_close"
|
|
static let resetLaunchDateButton = "settings_reset_launch_date"
|
|
static let fixWeekdayButton = "settings_fix_weekday"
|
|
static let whyBackgroundModeButton = "settings_why_bg_mode"
|
|
static let exportLegacyButton = "settings_export_legacy"
|
|
static let importButton = "settings_import"
|
|
static let randomIconsButton = "settings_random_icons"
|
|
static let doneButton = "settings_done"
|
|
static let specialThanksButton = "settings_special_thanks"
|
|
}
|
|
|
|
// MARK: - TipModal
|
|
enum TipModal {
|
|
static let dismissButton = "tip_modal_dismiss"
|
|
static let resetTipsButton = "tip_modal_reset_tips"
|
|
static let tipsEnabledToggle = "tip_modal_tips_enabled"
|
|
static let doneButton = "tip_modal_done"
|
|
static func tipPreviewButton(_ index: Int) -> String {
|
|
"tip_modal_preview_\(index)"
|
|
}
|
|
}
|
|
|
|
// MARK: - Customize
|
|
enum Customize {
|
|
static let themeSection = "customize_theme_section"
|
|
static let browseThemesButton = "browse_themes_button"
|
|
static let appThemePickerDoneButton = "apptheme_picker_done"
|
|
static let appThemePreviewCancelButton = "apptheme_preview_cancel"
|
|
static let appThemePreviewApplyButton = "apptheme_preview_apply"
|
|
static let widgetHowToLink = "customize_widget_how_to_link"
|
|
static func themeButton(_ name: String) -> String {
|
|
"customize_theme_\(name.lowercased())"
|
|
}
|
|
static func votingLayoutButton(_ name: String) -> String {
|
|
"customize_voting_\(name.lowercased())"
|
|
}
|
|
static func dayViewStyleButton(_ name: String) -> String {
|
|
"customize_daystyle_\(name.lowercased())"
|
|
}
|
|
static func iconPackButton(_ name: String) -> String {
|
|
"customize_iconpack_\(name.lowercased())"
|
|
}
|
|
static func personalityPackButton(_ name: String) -> String {
|
|
"customize_personality_\(name.lowercased())"
|
|
}
|
|
static func appThemeCard(_ name: String) -> String {
|
|
"apptheme_card_\(name.lowercased())"
|
|
}
|
|
static func customWidget(_ index: Int) -> String {
|
|
"customize_widget_\(index)"
|
|
}
|
|
static let customWidgetAdd = "customize_widget_add"
|
|
static func shapeOption(_ name: String) -> String {
|
|
"customize_shape_\(name.lowercased())"
|
|
}
|
|
static let shapeRefresh = "customize_shape_refresh"
|
|
static func imagePackOption(_ name: String) -> String {
|
|
"customize_imagepack_option_\(name.lowercased())"
|
|
}
|
|
static func personalityPackOption(_ name: String) -> String {
|
|
"customize_personalitypack_option_\(name.lowercased())"
|
|
}
|
|
static func celebrationAnimationButton(_ name: String) -> String {
|
|
"customize_celebration_\(name.lowercased())"
|
|
}
|
|
static let manageSubscriptionButton = "customize_manage_subscription"
|
|
static let unlockPremiumButton = "customize_unlock_premium"
|
|
static func dayFilterButton(_ day: String) -> String {
|
|
"customize_day_filter_\(day.lowercased())"
|
|
}
|
|
static func iconButton(_ name: String) -> String {
|
|
"customize_icon_\(name.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - Paywall
|
|
enum Paywall {
|
|
static let monthOverlay = "paywall_month_overlay"
|
|
static let yearOverlay = "paywall_year_overlay"
|
|
static let insightsOverlay = "paywall_insights_overlay"
|
|
static let monthUnlockButton = "paywall_month_unlock"
|
|
static let yearUnlockButton = "paywall_year_unlock"
|
|
static let insightsUnlockButton = "paywall_insights_unlock"
|
|
static let reportsUnlockButton = "paywall_reports_unlock"
|
|
}
|
|
|
|
// MARK: - Day View Section Headers
|
|
enum DaySection {
|
|
static func header(month: Int, year: Int) -> String {
|
|
"day_section_\(month)_\(year)"
|
|
}
|
|
}
|
|
|
|
// MARK: - Insights
|
|
enum Insights {
|
|
static let header = "insights_header"
|
|
static let monthSection = "insights_month_section"
|
|
static let yearSection = "insights_year_section"
|
|
static let allTimeSection = "insights_all_time_section"
|
|
static let expandCollapseButton = "insights_expand_collapse"
|
|
}
|
|
|
|
// MARK: - Month View
|
|
enum MonthView {
|
|
static let grid = "month_grid"
|
|
static let shareButton = "month_share_button"
|
|
static let statsToggleButton = "month_stats_toggle"
|
|
static let settingsButton = "month_settings_button"
|
|
static func dayCell(dateString: String) -> String {
|
|
"month_day_cell_\(dateString)"
|
|
}
|
|
static let debugDemoToggle = "month_debug_demo_toggle"
|
|
}
|
|
|
|
// MARK: - Month Detail
|
|
enum MonthDetail {
|
|
static let shareButton = "month_detail_share"
|
|
static let deleteButton = "month_detail_delete"
|
|
static let cancelButton = "month_detail_cancel"
|
|
static func moodButton(_ mood: String) -> String {
|
|
"month_detail_mood_\(mood.lowercased())"
|
|
}
|
|
static func entryCell(_ dateString: String) -> String {
|
|
"month_detail_entry_\(dateString)"
|
|
}
|
|
}
|
|
|
|
// MARK: - Year View
|
|
enum YearView {
|
|
static let heatmap = "year_heatmap"
|
|
static let donutChart = "year_donut_chart"
|
|
static let barChart = "year_bar_chart"
|
|
static let statsSection = "year_stats_section"
|
|
static func cardHeader(year: Int) -> String { "year_card_header_\(year)" }
|
|
static let shareButton = "year_share_button"
|
|
static let debugDemoToggle = "year_debug_demo_toggle"
|
|
}
|
|
|
|
// MARK: - Onboarding
|
|
enum Onboarding {
|
|
static let container = "onboarding_container"
|
|
static let welcomeScreen = "onboarding_welcome"
|
|
static let timeScreen = "onboarding_time"
|
|
static let dayScreen = "onboarding_day"
|
|
static let dayToday = "onboarding_day_today"
|
|
static let dayYesterday = "onboarding_day_yesterday"
|
|
static let styleScreen = "onboarding_style"
|
|
static let subscriptionScreen = "onboarding_subscription"
|
|
static let subscribeButton = "onboarding_subscribe_button"
|
|
static let skipButton = "onboarding_skip_button"
|
|
static let nextButton = "onboarding_next_button"
|
|
static let timePicker = "onboarding_time_picker"
|
|
static let wrapupContinue = "onboarding_wrapup_continue"
|
|
static let titleOptionButton = "onboarding_title_option"
|
|
static func styleThemeButton(_ name: String) -> String {
|
|
"onboarding_style_theme_\(name.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - Reports
|
|
enum Reports {
|
|
static let segmentedPicker = "reports_segmented_picker"
|
|
static let dateRangePicker = "reports_date_range_picker"
|
|
static let previousMonthButton = "reports_previous_month"
|
|
static let nextMonthButton = "reports_next_month"
|
|
static func dayCell(dateString: String) -> String {
|
|
"reports_day_cell_\(dateString)"
|
|
}
|
|
static let quickSummaryButton = "reports_quick_summary_button"
|
|
static let detailedReportButton = "reports_detailed_report_button"
|
|
static let generateButton = "reports_generate_button"
|
|
static let progressView = "reports_progress_view"
|
|
static let cancelButton = "reports_cancel_button"
|
|
static let exportButton = "reports_export_button"
|
|
static let privacyConfirmation = "reports_privacy_confirmation"
|
|
static let minimumEntriesWarning = "reports_minimum_entries_warning"
|
|
static let exportDataButton = "reports_export_data_button"
|
|
static let retryButton = "reports_retry_button"
|
|
static let privacyShareButton = "reports_privacy_share"
|
|
static let privacyCancelButton = "reports_privacy_cancel"
|
|
}
|
|
|
|
// MARK: - Purchase / Subscription
|
|
enum Purchase {
|
|
static let manageSubscriptionButton = "purchase_manage_subscription"
|
|
static let changePlanButton = "purchase_change_plan"
|
|
static let restorePurchasesButton = "purchase_restore"
|
|
static let subscribeButton = "purchase_subscribe"
|
|
}
|
|
|
|
// MARK: - Subscription Store
|
|
enum SubscriptionStore {
|
|
static let closeButton = "subscription_store_close"
|
|
}
|
|
|
|
// MARK: - IAP Warning
|
|
enum IAPWarning {
|
|
static let subscribeButton = "iap_warning_subscribe"
|
|
}
|
|
|
|
// MARK: - Lock Screen
|
|
enum LockScreen {
|
|
static let unlockButton = "lock_screen_unlock"
|
|
static let tryAgainButton = "lock_screen_try_again"
|
|
static let cancelButton = "lock_screen_cancel"
|
|
static let passcodeUnlockButton = "lock_screen_passcode_unlock"
|
|
static func passcodeButton(_ digit: Int) -> String {
|
|
"lock_screen_passcode_\(digit)"
|
|
}
|
|
}
|
|
|
|
// MARK: - Full Screen Photo
|
|
enum FullScreenPhoto {
|
|
static let closeButton = "full_screen_photo_close"
|
|
static let dismissArea = "full_screen_photo_dismiss"
|
|
}
|
|
|
|
// MARK: - Export
|
|
enum Export {
|
|
static let cancelButton = "export_cancel"
|
|
static let exportButton = "export_export"
|
|
static let alertOKButton = "export_alert_ok"
|
|
static func formatButton(_ format: String) -> String {
|
|
"export_format_\(format.lowercased())"
|
|
}
|
|
static func rangeButton(_ range: String) -> String {
|
|
"export_range_\(range.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - Photo Picker
|
|
enum PhotoPicker {
|
|
static let cameraButton = "photo_picker_camera"
|
|
static let cancelButton = "photo_picker_cancel"
|
|
static let closeButton = "photo_picker_close"
|
|
static let shareButton = "photo_picker_share"
|
|
static let deleteButton = "photo_picker_delete"
|
|
static let deleteConfirmButton = "photo_picker_delete_confirm"
|
|
static let deleteCancelButton = "photo_picker_delete_cancel"
|
|
static let photosPicker = "photo_picker_library"
|
|
static let photoImage = "photo_picker_image"
|
|
static let menuButton = "photo_picker_menu"
|
|
}
|
|
|
|
// MARK: - Sharing
|
|
enum Sharing {
|
|
static let exitButton = "sharing_exit"
|
|
static let shareButton = "sharing_share"
|
|
static func moodMenuButton(_ mood: String) -> String {
|
|
"sharing_mood_menu_\(mood.lowercased())"
|
|
}
|
|
static let moodMenu = "sharing_mood_menu"
|
|
static func templateButton(_ description: String) -> String {
|
|
"sharing_template_\(description.lowercased().replacingOccurrences(of: " ", with: "_"))"
|
|
}
|
|
}
|
|
|
|
// MARK: - Sharing Templates
|
|
enum SharingTemplate {
|
|
static let dismissButton = "sharing_template_dismiss"
|
|
static let shareButton = "sharing_template_share"
|
|
static let moodMenu = "sharing_template_mood_menu"
|
|
static func moodMenuButton(_ mood: String) -> String {
|
|
"sharing_template_mood_menu_\(mood.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - Custom Widget
|
|
enum CustomWidget {
|
|
static func colorPicker(_ name: String) -> String {
|
|
"custom_widget_color_\(name.lowercased())"
|
|
}
|
|
static let leftEyeButton = "custom_widget_left_eye"
|
|
static let rightEyeButton = "custom_widget_right_eye"
|
|
static let mouthButton = "custom_widget_mouth"
|
|
static func backgroundOption(_ index: Int) -> String {
|
|
"custom_widget_bg_\(index)"
|
|
}
|
|
static let randomBackgroundButton = "custom_widget_random_bg"
|
|
static let shuffleButton = "custom_widget_shuffle"
|
|
static let saveButton = "custom_widget_save"
|
|
static let useButton = "custom_widget_use"
|
|
static let deleteButton = "custom_widget_delete"
|
|
static func imageOption(_ name: String) -> String {
|
|
"custom_widget_image_\(name.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - Debug / Preview
|
|
enum Debug {
|
|
static let animationDoneButton = "debug_animation_done"
|
|
static func animationCard(_ name: String) -> String {
|
|
"debug_animation_\(name.lowercased())"
|
|
}
|
|
static func debugMoodButton(_ mood: String) -> String {
|
|
"debug_mood_\(mood.lowercased())"
|
|
}
|
|
static let paywallPreviewDoneButton = "debug_paywall_done"
|
|
static let viewFullPaywallButton = "debug_view_full_paywall"
|
|
static func paywallStyleOption(_ name: String) -> String {
|
|
"debug_paywall_style_\(name.lowercased())"
|
|
}
|
|
static let liveActivityResetButton = "debug_live_activity_reset"
|
|
static let liveActivityToggleButton = "debug_live_activity_toggle"
|
|
static let liveActivityRecordButton = "debug_live_activity_record"
|
|
static let liveActivityDismissButton = "debug_live_activity_dismiss"
|
|
static let liveActivityExportButton = "debug_live_activity_export"
|
|
}
|
|
|
|
// MARK: - Sample Entry
|
|
enum SampleEntry {
|
|
static let refreshButton = "sample_entry_refresh"
|
|
}
|
|
|
|
// MARK: - Switchable View
|
|
enum SwitchableView {
|
|
static let headerToggle = "switchable_view_header_toggle"
|
|
}
|
|
|
|
// MARK: - Neon Mood Button (voting layout)
|
|
enum NeonMoodButton {
|
|
static func id(for mood: String) -> String {
|
|
"neon_mood_button_\(mood.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - App Alerts
|
|
enum AppAlert {
|
|
static let storageUnavailableOK = "app_alert_storage_ok"
|
|
}
|
|
|
|
// MARK: - Watch
|
|
enum Watch {
|
|
static func moodButton(_ mood: String) -> String {
|
|
"watch_mood_button_\(mood.lowercased())"
|
|
}
|
|
}
|
|
|
|
// MARK: - Widget
|
|
enum Widget {
|
|
static func voteMoodButton(_ mood: String) -> String {
|
|
"widget_vote_mood_\(mood.lowercased())"
|
|
}
|
|
static let subscribeLink = "widget_subscribe_link"
|
|
}
|
|
|
|
// MARK: - Common
|
|
enum Common {
|
|
static let lockScreen = "lock_screen"
|
|
static let onboarding = "onboarding_sheet"
|
|
}
|
|
}
|