Files
honeyDueKMP/iosApp/HoneyDueUITests/Framework/SeededTestData.swift
treyt 5c360a2796 Rearchitect UI test suite for complete, non-flaky coverage against live API
- Migrate Suite4-10, SmokeTests, NavigationCriticalPathTests to AuthenticatedTestCase
  with seeded admin account and real backend login
- Add 34 accessibility identifiers across 11 app views (task completion, profile,
  notifications, theme, join residence, manage users, forms)
- Create FeatureCoverageTests (14 tests) covering previously untested features:
  profile edit, theme selection, notification prefs, task completion, manage users,
  join residence, task templates
- Create MultiUserSharingTests (18 API tests) and MultiUserSharingUITests (8 XCUI
  tests) for full cross-user residence sharing lifecycle
- Add cleanup infrastructure: SuiteZZ_CleanupTests auto-wipes test data after runs,
  cleanup_test_data.sh script for manual reset via admin API
- Add share code API methods to TestAccountAPIClient (generateShareCode, joinWithCode,
  getShareCode, listResidenceUsers, removeUser)
- Fix app bugs found by tests:
  - ResidencesListView join callback now uses forceRefresh:true
  - APILayer invalidates task cache when residence count changes
  - AllTasksView auto-reloads tasks when residence list changes
- Fix test quality: keyboard focus waits, Save/Add button label matching,
  Documents tab label (Docs), remove API verification from UI tests
- DataLayerTests and PasswordResetTests now verify through UI, not API calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 17:32:13 -05:00

58 lines
1.4 KiB
Swift

import Foundation
/// Shared constants and mutable state for baseline data seeded by `Suite00_SeedTests`.
///
/// Other test suites can reference these values to locate pre-existing backend
/// entities without hard-coding names or IDs in multiple places.
enum SeededTestData {
// MARK: - Accounts
enum TestUser {
static let username = "testuser"
static let email = "test@example.com"
static let password = "TestPass123!"
}
enum AdminUser {
static let username = "admin"
static let email = "admin@example.com"
static let password = "test1234"
}
// MARK: - Entities (populated by Suite00)
enum Residence {
static let name = "Seed Home"
/// Set by Suite00 after creation/lookup. `-1` means not yet seeded.
static var id: Int = -1
}
enum Task {
static let title = "Seed Task"
static var id: Int = -1
}
enum Contractor {
static let name = "Seed Contractor"
static var id: Int = -1
}
enum Document {
static let title = "Seed Document"
static var id: Int = -1
}
// MARK: - Tokens (populated by Suite00)
static var testUserToken: String?
static var adminUserToken: String?
// MARK: - Status
/// `true` once all entity IDs have been populated.
static var isSeeded: Bool {
Residence.id != -1 && Task.id != -1 && Contractor.id != -1 && Document.id != -1
}
}