Stabilize iOS UI test foundation and fix flaky suites
This commit is contained in:
@@ -75,6 +75,9 @@ enum AccessibilityID {
|
||||
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 func themeButton(_ name: String) -> String {
|
||||
"customize_theme_\(name.lowercased())"
|
||||
}
|
||||
|
||||
@@ -169,6 +169,7 @@ struct DayOptionCard: View {
|
||||
)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityLabel("\(title), \(subtitle)")
|
||||
.accessibilityHint(example)
|
||||
.accessibilityAddTraits(isSelected ? [.isSelected] : [])
|
||||
|
||||
@@ -91,6 +91,7 @@ struct OnboardingStyle: View {
|
||||
// Apply default theme on appear
|
||||
selectedTheme.apply()
|
||||
}
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.styleScreen)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@ struct OnboardingSubscription: View {
|
||||
.shadow(color: .black.opacity(0.15), radius: 10, y: 5)
|
||||
)
|
||||
}
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.subscribeButton)
|
||||
.accessibilityLabel(String(localized: "Get Personal Insights"))
|
||||
.accessibilityHint(String(localized: "Opens subscription options"))
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.subscribeButton)
|
||||
|
||||
// Skip button
|
||||
Button(action: {
|
||||
@@ -128,10 +128,11 @@ struct OnboardingSubscription: View {
|
||||
Text("Maybe Later")
|
||||
.font(.body.weight(.medium))
|
||||
.foregroundColor(.white.opacity(0.8))
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.skipButton)
|
||||
}
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.skipButton)
|
||||
.accessibilityLabel(String(localized: "Maybe Later"))
|
||||
.accessibilityHint(String(localized: "Skip subscription and complete setup"))
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.skipButton)
|
||||
.padding(.top, 4)
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
|
||||
@@ -93,6 +93,7 @@ struct OnboardingTime: View {
|
||||
.accessibilityElement(children: .combine)
|
||||
}
|
||||
}
|
||||
.accessibilityIdentifier(AccessibilityID.Onboarding.timeScreen)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ struct AppThemePickerView: View {
|
||||
Button("Done") {
|
||||
dismiss()
|
||||
}
|
||||
.accessibilityIdentifier(AccessibilityID.Customize.appThemePickerDoneButton)
|
||||
}
|
||||
}
|
||||
.sheet(item: $selectedTheme) { theme in
|
||||
@@ -250,6 +251,7 @@ struct AppThemePreviewSheet: View {
|
||||
Button("Cancel") {
|
||||
dismiss()
|
||||
}
|
||||
.accessibilityIdentifier(AccessibilityID.Customize.appThemePreviewCancelButton)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,6 +354,7 @@ struct AppThemePreviewSheet: View {
|
||||
.shadow(color: theme.previewColors[0].opacity(0.4), radius: 8, x: 0, y: 4)
|
||||
}
|
||||
.padding(.horizontal, 20)
|
||||
.accessibilityIdentifier(AccessibilityID.Customize.appThemePreviewApplyButton)
|
||||
}
|
||||
|
||||
private func iconName(for pack: MoodImages) -> String {
|
||||
|
||||
@@ -27,26 +27,31 @@ struct MainTabView: View {
|
||||
dayView
|
||||
.tabItem {
|
||||
Label(String(localized: "content_view_tab_main"), systemImage: "list.dash")
|
||||
.accessibilityIdentifier(AccessibilityID.Tab.day)
|
||||
}
|
||||
|
||||
monthView
|
||||
.tabItem {
|
||||
Label(String(localized: "content_view_tab_month"), systemImage: "calendar")
|
||||
.accessibilityIdentifier(AccessibilityID.Tab.month)
|
||||
}
|
||||
|
||||
yearView
|
||||
.tabItem {
|
||||
Label(String(localized: "content_view_tab_filter"), systemImage: "line.3.horizontal.decrease.circle")
|
||||
.accessibilityIdentifier(AccessibilityID.Tab.year)
|
||||
}
|
||||
|
||||
insightsView
|
||||
.tabItem {
|
||||
Label(String(localized: "content_view_tab_insights"), systemImage: "lightbulb.fill")
|
||||
.accessibilityIdentifier(AccessibilityID.Tab.insights)
|
||||
}
|
||||
|
||||
SettingsTabView()
|
||||
.tabItem {
|
||||
Label("Settings", systemImage: "gear")
|
||||
.accessibilityIdentifier(AccessibilityID.Tab.settings)
|
||||
}
|
||||
}
|
||||
.accentColor(textColor)
|
||||
|
||||
@@ -50,7 +50,9 @@ struct SettingsTabView: View {
|
||||
// Segmented control
|
||||
Picker("", selection: $selectedTab) {
|
||||
ForEach(SettingsTab.allCases, id: \.self) { tab in
|
||||
Text(tab.rawValue).tag(tab)
|
||||
Text(tab.rawValue)
|
||||
.accessibilityIdentifier(tab == .customize ? AccessibilityID.Settings.customizeTab : AccessibilityID.Settings.settingsTab)
|
||||
.tag(tab)
|
||||
}
|
||||
}
|
||||
.pickerStyle(.segmented)
|
||||
|
||||
Reference in New Issue
Block a user