Files
honeyDueKMP/iosApp/CaseraUITests/SimpleLoginTest.swift
Trey t c6eef720ed Rebrand from MyCrib to Casera
- Rename Kotlin package from com.example.mycrib to com.example.casera
- Update Android app name, namespace, and application ID
- Update iOS bundle identifiers and project settings
- Rename iOS directories (MyCribTests -> CaseraTests, etc.)
- Update deep link schemes from mycrib:// to casera://
- Update app group identifiers
- Update subscription product IDs
- Update all UI strings and branding

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:10:38 -06:00

64 lines
2.4 KiB
Swift

import XCTest
/// Simple test to verify basic app launch and login screen
/// This is the foundation test - if this works, we can build more complex tests
final class SimpleLoginTest: XCTestCase {
var app: XCUIApplication!
override func setUpWithError() throws {
continueAfterFailure = false
app = XCUIApplication()
app.launch()
// CRITICAL: Ensure we're logged out before each test
ensureLoggedOut()
}
override func tearDownWithError() throws {
app = nil
}
// MARK: - Helper Methods
/// Ensures the user is logged out and on the login screen
private func ensureLoggedOut() {
UITestHelpers.ensureLoggedOut(app: app)
}
// MARK: - Tests
/// Test 1: App launches and shows login screen (or logs out if needed)
func testAppLaunchesAndShowsLoginScreen() {
// After ensureLoggedOut(), we should be on login screen
let welcomeText = app.staticTexts["Welcome Back"]
XCTAssertTrue(welcomeText.exists, "Login screen with 'Welcome Back' text should appear after logout")
// Also check that we have a username field
let usernameField = app.textFields.containing(NSPredicate(format: "placeholderValue CONTAINS[c] 'email'")).firstMatch
XCTAssertTrue(usernameField.exists, "Username/email field should exist")
}
/// Test 2: Can type in username and password fields
func testCanTypeInLoginFields() {
// Already logged out from setUp
// Find and tap username field
let usernameField = app.textFields.containing(NSPredicate(format: "placeholderValue CONTAINS[c] 'email'")).firstMatch
XCTAssertTrue(usernameField.waitForExistence(timeout: 10), "Username field should exist")
usernameField.tap()
usernameField.typeText("testuser")
// Find password field (could be TextField or SecureField)
let passwordField = app.secureTextFields.containing(NSPredicate(format: "placeholderValue CONTAINS[c] 'password'")).firstMatch
XCTAssertTrue(passwordField.exists, "Password field should exist")
passwordField.tap()
passwordField.typeText("testpass123")
// Verify we can see a Sign In button
let signInButton = app.buttons.containing(NSPredicate(format: "label CONTAINS[c] 'Sign In'")).firstMatch
XCTAssertTrue(signInButton.exists, "Sign In button should exist")
}
}