Files
honeyDueKMP/iosApp/HoneyDueUITests/Framework/TestFlows.swift
Trey t 1e2adf7660 Rebrand from Casera/MyCrib to honeyDue
Total rebrand across KMM project:
- Kotlin package: com.example.casera -> com.tt.honeyDue (dirs + declarations)
- Gradle: rootProject.name, namespace, applicationId
- Android: manifest, strings.xml (all languages), widget resources
- iOS: pbxproj bundle IDs, Info.plist, entitlements, xcconfig
- iOS directories: Casera/ -> HoneyDue/, CaseraTests/ -> HoneyDueTests/, etc.
- Swift source: all class/struct/enum renames
- Deep links: casera:// -> honeydue://, .casera -> .honeydue
- App icons replaced with honeyDue honeycomb icon
- Domains: casera.treytartt.com -> honeyDue.treytartt.com
- Bundle IDs: com.tt.casera -> com.tt.honeyDue
- Database table names preserved

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 06:33:57 -06:00

96 lines
3.3 KiB
Swift

import XCTest
enum TestFlows {
@discardableResult
static func navigateToLoginFromOnboarding(app: XCUIApplication) -> LoginScreenObject {
let welcome = OnboardingWelcomeScreen(app: app)
welcome.waitForLoad()
welcome.tapAlreadyHaveAccount()
let login = LoginScreenObject(app: app)
login.waitForLoad()
return login
}
@discardableResult
static func navigateStartFreshToCreateAccount(
app: XCUIApplication,
residenceName: String = "UI Test Residence"
) -> OnboardingCreateAccountScreen {
let welcome = OnboardingWelcomeScreen(app: app)
welcome.waitForLoad()
welcome.tapStartFresh()
let valueProps = OnboardingValuePropsScreen(app: app)
valueProps.waitForLoad()
valueProps.tapContinue()
let nameResidence = OnboardingNameResidenceScreen(app: app)
nameResidence.waitForLoad()
nameResidence.enterResidenceName(residenceName)
nameResidence.tapContinue()
let createAccount = OnboardingCreateAccountScreen(app: app)
createAccount.waitForLoad()
return createAccount
}
/// Type credentials into the login screen and tap login.
/// Assumes the app is already showing the login screen.
static func loginWithCredentials(app: XCUIApplication, username: String, password: String) {
let login = LoginScreenObject(app: app)
login.waitForLoad()
login.enterUsername(username)
login.enterPassword(password)
let loginButton = app.buttons[UITestID.Auth.loginButton]
loginButton.waitUntilHittable(timeout: 10).tap()
}
/// Drive the full forgot password verify code reset password flow using the debug code.
static func completeForgotPasswordFlow(
app: XCUIApplication,
email: String,
newPassword: String,
confirmPassword: String? = nil
) {
let confirm = confirmPassword ?? newPassword
// Step 1: Enter email on forgot password screen
let forgotScreen = ForgotPasswordScreen(app: app)
forgotScreen.waitForLoad()
forgotScreen.enterEmail(email)
forgotScreen.tapSendCode()
// Step 2: Enter debug verification code
let verifyScreen = VerifyResetCodeScreen(app: app)
verifyScreen.waitForLoad()
verifyScreen.enterCode(TestAccountAPIClient.debugVerificationCode)
verifyScreen.tapVerify()
// Step 3: Enter new password
let resetScreen = ResetPasswordScreen(app: app)
resetScreen.waitForLoad()
resetScreen.enterNewPassword(newPassword)
resetScreen.enterConfirmPassword(confirm)
resetScreen.tapReset()
}
@discardableResult
static func openRegisterFromLogin(app: XCUIApplication) -> RegisterScreenObject {
let login: LoginScreenObject
let loginRoot = app.otherElements[UITestID.Root.login]
if loginRoot.exists || app.textFields[UITestID.Auth.usernameField].exists {
login = LoginScreenObject(app: app)
login.waitForLoad()
} else {
login = navigateToLoginFromOnboarding(app: app)
}
login.tapSignUp()
let register = RegisterScreenObject(app: app)
register.waitForLoad()
return register
}
}