Refactor iOS UI tests to blueprint architecture
This commit is contained in:
164
iosApp/CaseraUITests/Docs/Failing_Suites_0_3_Rebuild_Plan.md
Normal file
164
iosApp/CaseraUITests/Docs/Failing_Suites_0_3_Rebuild_Plan.md
Normal file
@@ -0,0 +1,164 @@
|
||||
# Failing Suites 0-3: Coverage + Rebuild Plan
|
||||
|
||||
## Baseline (from observed runs)
|
||||
- `Suite0_OnboardingTests`: 1 test, 1 failure
|
||||
- `Suite1_RegistrationTests`: 11 tests, 5 failures
|
||||
- `Suite2_AuthenticationTests`: 6 tests, 2 failures
|
||||
- `Suite3_ResidenceTests`: 6 tests, 6 failures
|
||||
|
||||
Primary failure logs used:
|
||||
- `/tmp/ui_suite0.log`
|
||||
- `/tmp/ui_suites_1_3.log`
|
||||
|
||||
---
|
||||
|
||||
## Suite0
|
||||
|
||||
### Failing test
|
||||
- `Suite0_OnboardingTests.test_onboarding`
|
||||
|
||||
### What it is testing
|
||||
- End-to-end onboarding progression from welcome/login entry into account creation and onward.
|
||||
- UI interaction stability during onboarding form entry.
|
||||
|
||||
### Observed failure point
|
||||
- Assertion failure: `Email field must become focused for typing`.
|
||||
|
||||
### Rebuild in new arch
|
||||
Create a new test case focused on deterministic onboarding field interaction:
|
||||
- `Onboarding_EmailRegistration_FocusAndInputFlow`
|
||||
|
||||
Coverage to preserve:
|
||||
- Email field reliably focusable and typeable.
|
||||
- Continue action only enabled after valid required inputs.
|
||||
- Onboarding progresses to next state after valid submission.
|
||||
|
||||
Required infra:
|
||||
- `OnboardingScreen` page object with `tapEmailField()`, `typeEmail()`, `assertEmailFieldFocused()`.
|
||||
- Keyboard/overlay helper centralized (not inline in tests).
|
||||
|
||||
---
|
||||
|
||||
## Suite1
|
||||
Detailed plan already captured in:
|
||||
- `/Users/treyt/Desktop/code/MyCribKMM/iosApp/CaseraUITests/Docs/Suite1_Failing_Test_Rebuild_Plan.md`
|
||||
|
||||
### Failing tests
|
||||
- `test07_successfulRegistrationAndVerification`
|
||||
- `test09_registrationWithInvalidVerificationCode`
|
||||
- `test10_verificationCodeFieldValidation`
|
||||
- `test11_appRelaunchWithUnverifiedUser`
|
||||
- `test12_logoutFromVerificationScreen`
|
||||
|
||||
### Rebuild targets
|
||||
- `Registration_HappyPath_CompletesVerification_ThenCanLogout`
|
||||
- `Registration_InvalidVerifyCode_ShowsError_StaysUnverified`
|
||||
- `Registration_IncompleteVerifyCode_DoesNotVerify`
|
||||
- `Registration_UnverifiedUser_RelaunchStillBlockedFromMain`
|
||||
- `Registration_VerificationScreenLogout_ReturnsToLogin`
|
||||
|
||||
---
|
||||
|
||||
## Suite2
|
||||
|
||||
### Failing tests
|
||||
- `Suite2_AuthenticationTests.test02_loginWithValidCredentials`
|
||||
- `Suite2_AuthenticationTests.test06_logout`
|
||||
|
||||
### What they are testing
|
||||
|
||||
#### `test02_loginWithValidCredentials`
|
||||
- Valid login path transitions from login screen to main app.
|
||||
- Authenticated state exposes main navigation (tab bar/app root).
|
||||
|
||||
#### `test06_logout`
|
||||
- Logged-in user can logout.
|
||||
- Session is cleared and app returns to login state.
|
||||
|
||||
### Observed failure points
|
||||
- `test02`: `Should navigate to main app after successful login`
|
||||
- `test06`: `Should be logged in` (precondition for logout flow failed)
|
||||
|
||||
### Rebuild in new arch
|
||||
Create explicit state-driven auth tests:
|
||||
- `Auth_ValidLogin_TransitionsToMainApp`
|
||||
- `Auth_Logout_FromMainApp_ReturnsToLogin`
|
||||
|
||||
Coverage to preserve:
|
||||
- Login success sets authenticated UI state.
|
||||
- Logout always clears authenticated state.
|
||||
- No false-positive “logged in” assumptions.
|
||||
|
||||
Required infra:
|
||||
- `LoginScreen`, `MainTabScreen`, `ProfileScreen` page objects.
|
||||
- `AuthAssertions.assertAtLoginRoot()`, `assertAtMainRoot()`.
|
||||
- Test user fixture policy for valid credentials.
|
||||
|
||||
---
|
||||
|
||||
## Suite3
|
||||
|
||||
### Failing tests
|
||||
- `Suite3_ResidenceTests.test01_viewResidencesList`
|
||||
- `Suite3_ResidenceTests.test02_navigateToAddResidence`
|
||||
- `Suite3_ResidenceTests.test03_navigationBetweenTabs`
|
||||
- `Suite3_ResidenceTests.test04_cancelResidenceCreation`
|
||||
- `Suite3_ResidenceTests.test05_createResidenceWithMinimalData`
|
||||
- `Suite3_ResidenceTests.test06_viewResidenceDetails`
|
||||
|
||||
### What they are testing
|
||||
- Residence tab/list visibility.
|
||||
- Navigation to add-residence form.
|
||||
- Cross-tab navigation sanity.
|
||||
- Canceling residence creation.
|
||||
- Creating residence with minimal fields.
|
||||
- Opening residence details.
|
||||
|
||||
### Observed failure pattern
|
||||
All 6 fail at the same gateway:
|
||||
- No `Residences` tab bar button match found.
|
||||
- This indicates tests are not reaching authenticated main-app state before residence assertions.
|
||||
|
||||
### Rebuild in new arch
|
||||
Split auth precondition from residence behavior:
|
||||
- `Residence_Precondition_AuthenticatedAndAtResidencesTab`
|
||||
- `Residence_OpenCreateForm`
|
||||
- `Residence_CancelCreate_ReturnsToList`
|
||||
- `Residence_CreateMinimal_ShowsInList`
|
||||
- `Residence_OpenDetails_FromList`
|
||||
- `Residence_TabNavigation_MainSections`
|
||||
|
||||
Coverage to preserve:
|
||||
- Residence flows validated only after explicit `main app ready` assertion.
|
||||
- Failures clearly classify as auth-gate vs residence-feature regression.
|
||||
|
||||
Required infra:
|
||||
- `MainTabScreen.goToResidences()` with ID-first selectors.
|
||||
- `ResidenceListScreen`, `ResidenceFormScreen`, `ResidenceDetailScreen` page objects.
|
||||
- Shared precondition helper: `ensureAuthenticatedMainApp()`.
|
||||
|
||||
---
|
||||
|
||||
## Blueprint-aligned migration notes
|
||||
- Keep old-to-new mapping explicit in PR description.
|
||||
- Replace brittle text-based selectors with accessibility IDs first.
|
||||
- Use one state assertion per transition boundary:
|
||||
- `login -> verification -> main app -> login`.
|
||||
- Move keyboard/strong-password overlay handling into one helper.
|
||||
- Do not mark legacy tests removed until replacement coverage is green.
|
||||
|
||||
## Proposed replacement matrix
|
||||
- `Suite0.test_onboarding` -> `Onboarding_EmailRegistration_FocusAndInputFlow`
|
||||
- `Suite1.test07` -> `Registration_HappyPath_CompletesVerification_ThenCanLogout`
|
||||
- `Suite1.test09` -> `Registration_InvalidVerifyCode_ShowsError_StaysUnverified`
|
||||
- `Suite1.test10` -> `Registration_IncompleteVerifyCode_DoesNotVerify`
|
||||
- `Suite1.test11` -> `Registration_UnverifiedUser_RelaunchStillBlockedFromMain`
|
||||
- `Suite1.test12` -> `Registration_VerificationScreenLogout_ReturnsToLogin`
|
||||
- `Suite2.test02` -> `Auth_ValidLogin_TransitionsToMainApp`
|
||||
- `Suite2.test06` -> `Auth_Logout_FromMainApp_ReturnsToLogin`
|
||||
- `Suite3.test01` -> `Residence_Precondition_AuthenticatedAndAtResidencesTab`
|
||||
- `Suite3.test02` -> `Residence_OpenCreateForm`
|
||||
- `Suite3.test03` -> `Residence_TabNavigation_MainSections`
|
||||
- `Suite3.test04` -> `Residence_CancelCreate_ReturnsToList`
|
||||
- `Suite3.test05` -> `Residence_CreateMinimal_ShowsInList`
|
||||
- `Suite3.test06` -> `Residence_OpenDetails_FromList`
|
||||
Reference in New Issue
Block a user