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>
This commit is contained in:
111
iosApp/HoneyDueUITests/CriticalPath/AuthCriticalPathTests.swift
Normal file
111
iosApp/HoneyDueUITests/CriticalPath/AuthCriticalPathTests.swift
Normal file
@@ -0,0 +1,111 @@
|
||||
import XCTest
|
||||
|
||||
/// Critical path tests for authentication flows.
|
||||
///
|
||||
/// Validates login, logout, registration entry, and password reset entry.
|
||||
/// Zero sleep() calls — all waits are condition-based.
|
||||
final class AuthCriticalPathTests: XCTestCase {
|
||||
var app: XCUIApplication!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
continueAfterFailure = false
|
||||
app = TestLaunchConfig.launchApp()
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
app = nil
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
// MARK: - Login
|
||||
|
||||
func testLoginWithValidCredentials() {
|
||||
let login = LoginScreen(app: app)
|
||||
guard login.emailField.waitForExistence(timeout: 15) else {
|
||||
// Already logged in — verify main screen
|
||||
let main = MainTabScreen(app: app)
|
||||
XCTAssertTrue(main.isDisplayed, "Main screen should be visible when already logged in")
|
||||
return
|
||||
}
|
||||
|
||||
let user = TestFixtures.TestUser.existing
|
||||
login.login(email: user.email, password: user.password)
|
||||
|
||||
let main = MainTabScreen(app: app)
|
||||
XCTAssertTrue(
|
||||
main.residencesTab.waitForExistence(timeout: 15),
|
||||
"Should navigate to main screen after successful login"
|
||||
)
|
||||
}
|
||||
|
||||
func testLoginWithInvalidCredentials() {
|
||||
let login = LoginScreen(app: app)
|
||||
guard login.emailField.waitForExistence(timeout: 15) else {
|
||||
return // Already logged in, skip
|
||||
}
|
||||
|
||||
login.login(email: "invaliduser", password: "wrongpassword")
|
||||
|
||||
// Should stay on login screen — email field should still exist
|
||||
XCTAssertTrue(
|
||||
login.emailField.waitForExistence(timeout: 10),
|
||||
"Should remain on login screen after invalid credentials"
|
||||
)
|
||||
|
||||
// Tab bar should NOT appear
|
||||
let tabBar = app.tabBars.firstMatch
|
||||
XCTAssertFalse(tabBar.exists, "Tab bar should not appear after failed login")
|
||||
}
|
||||
|
||||
// MARK: - Logout
|
||||
|
||||
func testLogoutFlow() {
|
||||
let login = LoginScreen(app: app)
|
||||
if login.emailField.waitForExistence(timeout: 15) {
|
||||
let user = TestFixtures.TestUser.existing
|
||||
login.login(email: user.email, password: user.password)
|
||||
}
|
||||
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 15) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.logout()
|
||||
|
||||
// Should be back on login screen
|
||||
let loginAfterLogout = LoginScreen(app: app)
|
||||
XCTAssertTrue(
|
||||
loginAfterLogout.emailField.waitForExistence(timeout: 15),
|
||||
"Should return to login screen after logout"
|
||||
)
|
||||
}
|
||||
|
||||
// MARK: - Registration Entry
|
||||
|
||||
func testSignUpButtonNavigatesToRegistration() {
|
||||
let login = LoginScreen(app: app)
|
||||
guard login.emailField.waitForExistence(timeout: 15) else {
|
||||
return // Already logged in, skip
|
||||
}
|
||||
|
||||
let register = login.tapSignUp()
|
||||
XCTAssertTrue(register.isDisplayed, "Registration screen should appear after tapping Sign Up")
|
||||
}
|
||||
|
||||
// MARK: - Forgot Password Entry
|
||||
|
||||
func testForgotPasswordButtonExists() {
|
||||
let login = LoginScreen(app: app)
|
||||
guard login.emailField.waitForExistence(timeout: 15) else {
|
||||
return // Already logged in, skip
|
||||
}
|
||||
|
||||
XCTAssertTrue(
|
||||
login.forgotPasswordButton.waitForExistence(timeout: 5),
|
||||
"Forgot password button should exist on login screen"
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
import XCTest
|
||||
|
||||
/// Critical path tests for core navigation.
|
||||
///
|
||||
/// Validates tab bar navigation, settings access, and screen transitions.
|
||||
/// Requires a logged-in user. Zero sleep() calls — all waits are condition-based.
|
||||
final class NavigationCriticalPathTests: XCTestCase {
|
||||
var app: XCUIApplication!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
continueAfterFailure = false
|
||||
app = TestLaunchConfig.launchApp()
|
||||
ensureLoggedIn()
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
app = nil
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
private func ensureLoggedIn() {
|
||||
let login = LoginScreen(app: app)
|
||||
if login.emailField.waitForExistence(timeout: 15) {
|
||||
let user = TestFixtures.TestUser.existing
|
||||
login.login(email: user.email, password: user.password)
|
||||
}
|
||||
let main = MainTabScreen(app: app)
|
||||
_ = main.residencesTab.waitForExistence(timeout: 15)
|
||||
}
|
||||
|
||||
// MARK: - Tab Navigation
|
||||
|
||||
func testAllTabsExist() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
XCTAssertTrue(main.residencesTab.exists, "Residences tab should exist")
|
||||
XCTAssertTrue(main.tasksTab.exists, "Tasks tab should exist")
|
||||
XCTAssertTrue(main.contractorsTab.exists, "Contractors tab should exist")
|
||||
XCTAssertTrue(main.documentsTab.exists, "Documents tab should exist")
|
||||
}
|
||||
|
||||
func testNavigateToTasksTab() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToTasks()
|
||||
XCTAssertTrue(main.tasksTab.isSelected, "Tasks tab should be selected")
|
||||
}
|
||||
|
||||
func testNavigateToContractorsTab() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToContractors()
|
||||
XCTAssertTrue(main.contractorsTab.isSelected, "Contractors tab should be selected")
|
||||
}
|
||||
|
||||
func testNavigateToDocumentsTab() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToDocuments()
|
||||
XCTAssertTrue(main.documentsTab.isSelected, "Documents tab should be selected")
|
||||
}
|
||||
|
||||
func testNavigateBackToResidencesTab() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToDocuments()
|
||||
main.goToResidences()
|
||||
XCTAssertTrue(main.residencesTab.isSelected, "Residences tab should be selected")
|
||||
}
|
||||
|
||||
// MARK: - Settings Access
|
||||
|
||||
func testSettingsButtonExists() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToResidences()
|
||||
XCTAssertTrue(
|
||||
main.settingsButton.waitForExistence(timeout: 5),
|
||||
"Settings button should exist on Residences screen"
|
||||
)
|
||||
}
|
||||
|
||||
// MARK: - Add Buttons
|
||||
|
||||
func testResidenceAddButtonExists() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToResidences()
|
||||
let addButton = app.buttons[AccessibilityIdentifiers.Residence.addButton]
|
||||
XCTAssertTrue(
|
||||
addButton.waitForExistence(timeout: 5),
|
||||
"Residence add button should exist"
|
||||
)
|
||||
}
|
||||
|
||||
func testTaskAddButtonExists() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToTasks()
|
||||
let addButton = app.buttons[AccessibilityIdentifiers.Task.addButton]
|
||||
XCTAssertTrue(
|
||||
addButton.waitForExistence(timeout: 5),
|
||||
"Task add button should exist"
|
||||
)
|
||||
}
|
||||
|
||||
func testContractorAddButtonExists() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToContractors()
|
||||
let addButton = app.buttons[AccessibilityIdentifiers.Contractor.addButton]
|
||||
XCTAssertTrue(
|
||||
addButton.waitForExistence(timeout: 5),
|
||||
"Contractor add button should exist"
|
||||
)
|
||||
}
|
||||
|
||||
func testDocumentAddButtonExists() {
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 10) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
main.goToDocuments()
|
||||
let addButton = app.buttons[AccessibilityIdentifiers.Document.addButton]
|
||||
XCTAssertTrue(
|
||||
addButton.waitForExistence(timeout: 5),
|
||||
"Document add button should exist"
|
||||
)
|
||||
}
|
||||
}
|
||||
118
iosApp/HoneyDueUITests/CriticalPath/SmokeTests.swift
Normal file
118
iosApp/HoneyDueUITests/CriticalPath/SmokeTests.swift
Normal file
@@ -0,0 +1,118 @@
|
||||
import XCTest
|
||||
|
||||
/// Smoke tests - run on every PR. Must complete in <2 minutes.
|
||||
///
|
||||
/// Tests that the app launches successfully, the auth screen renders correctly,
|
||||
/// and core navigation is functional. These are the minimum-viability tests
|
||||
/// that must pass before any PR can merge.
|
||||
///
|
||||
/// Zero sleep() calls — all waits are condition-based.
|
||||
final class SmokeTests: XCTestCase {
|
||||
var app: XCUIApplication!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
continueAfterFailure = false
|
||||
app = TestLaunchConfig.launchApp()
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
app = nil
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
// MARK: - App Launch
|
||||
|
||||
func testAppLaunches() {
|
||||
// App should show either login screen or main tab view
|
||||
let loginScreen = LoginScreen(app: app)
|
||||
let mainScreen = MainTabScreen(app: app)
|
||||
|
||||
let loginAppeared = loginScreen.emailField.waitForExistence(timeout: 15)
|
||||
let mainAppeared = mainScreen.residencesTab.waitForExistence(timeout: 5)
|
||||
|
||||
XCTAssertTrue(loginAppeared || mainAppeared, "App should show login or main screen on launch")
|
||||
}
|
||||
|
||||
// MARK: - Login Screen Elements
|
||||
|
||||
func testLoginScreenElements() {
|
||||
let login = LoginScreen(app: app)
|
||||
guard login.emailField.waitForExistence(timeout: 15) else {
|
||||
// Already logged in, skip this test
|
||||
return
|
||||
}
|
||||
|
||||
XCTAssertTrue(login.emailField.exists, "Email field should exist")
|
||||
XCTAssertTrue(login.passwordField.exists, "Password field should exist")
|
||||
XCTAssertTrue(login.loginButton.exists, "Login button should exist")
|
||||
}
|
||||
|
||||
// MARK: - Login Flow
|
||||
|
||||
func testLoginWithExistingCredentials() {
|
||||
let login = LoginScreen(app: app)
|
||||
guard login.emailField.waitForExistence(timeout: 15) else {
|
||||
// Already on main screen - verify tabs
|
||||
let main = MainTabScreen(app: app)
|
||||
XCTAssertTrue(main.isDisplayed, "Main tabs should be visible")
|
||||
return
|
||||
}
|
||||
|
||||
// Login with the known test user
|
||||
let user = TestFixtures.TestUser.existing
|
||||
login.login(email: user.email, password: user.password)
|
||||
|
||||
let main = MainTabScreen(app: app)
|
||||
XCTAssertTrue(main.residencesTab.waitForExistence(timeout: 15), "Should navigate to main screen after login")
|
||||
}
|
||||
|
||||
// MARK: - Tab Navigation
|
||||
|
||||
func testMainTabsExistAfterLogin() {
|
||||
let login = LoginScreen(app: app)
|
||||
if login.emailField.waitForExistence(timeout: 15) {
|
||||
let user = TestFixtures.TestUser.existing
|
||||
login.login(email: user.email, password: user.password)
|
||||
}
|
||||
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 15) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
// App has 4 tabs: Residences, Tasks, Contractors, Documents
|
||||
XCTAssertTrue(main.residencesTab.exists, "Residences tab should exist")
|
||||
XCTAssertTrue(main.tasksTab.exists, "Tasks tab should exist")
|
||||
XCTAssertTrue(main.contractorsTab.exists, "Contractors tab should exist")
|
||||
XCTAssertTrue(main.documentsTab.exists, "Documents tab should exist")
|
||||
}
|
||||
|
||||
func testTabNavigation() {
|
||||
let login = LoginScreen(app: app)
|
||||
if login.emailField.waitForExistence(timeout: 15) {
|
||||
let user = TestFixtures.TestUser.existing
|
||||
login.login(email: user.email, password: user.password)
|
||||
}
|
||||
|
||||
let main = MainTabScreen(app: app)
|
||||
guard main.residencesTab.waitForExistence(timeout: 15) else {
|
||||
XCTFail("Main screen did not appear")
|
||||
return
|
||||
}
|
||||
|
||||
// Navigate through each tab and verify selection
|
||||
main.goToTasks()
|
||||
XCTAssertTrue(main.tasksTab.isSelected, "Tasks tab should be selected")
|
||||
|
||||
main.goToContractors()
|
||||
XCTAssertTrue(main.contractorsTab.isSelected, "Contractors tab should be selected")
|
||||
|
||||
main.goToDocuments()
|
||||
XCTAssertTrue(main.documentsTab.isSelected, "Documents tab should be selected")
|
||||
|
||||
main.goToResidences()
|
||||
XCTAssertTrue(main.residencesTab.isSelected, "Residences tab should be selected")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user