Refactor ZStack layouts to .background(), add Year View accessibility IDs, triage QA test plan
Replace ZStack-with-gradient patterns with idiomatic .background() modifier across onboarding, customize, and settings views. Add accessibility identifiers to Year View charts for UI test automation. Mark 67 impossible-to-automate tests RED in QA plan and scaffold initial Year View and Settings onboarding tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
100
uiTestPrompt.md
100
uiTestPrompt.md
@@ -1,53 +1,71 @@
|
||||
# UI Test Prompt Template
|
||||
# UI Test Prompt Template (QA Plan Driven)
|
||||
|
||||
Copy/paste this prompt into Codex or Claude and replace the placeholders.
|
||||
Copy/paste this into Claude (or Codex), then replace placeholders.
|
||||
|
||||
```md
|
||||
Create an iOS UI test for this behavior:
|
||||
Task:
|
||||
Create 3 solid iOS UI tests from the QA plan that compile and run reliably using the existing test architecture.
|
||||
|
||||
<DESCRIBE USER FLOW / EXPECTED BEHAVIOR>
|
||||
Project:
|
||||
- Root: /Users/treyt/Desktop/code/Feels
|
||||
- QA source: /Users/treyt/Desktop/code/Feels/docs/Feels_QA_Test_Plan.xlsx
|
||||
|
||||
Repository context:
|
||||
- Project root: /Users/treyt/Desktop/code/Feels
|
||||
- Follow these files strictly:
|
||||
- /Users/treyt/Desktop/code/Feels/docs/XCUITest-Authoring.md
|
||||
- /Users/treyt/Desktop/code/Feels/AGENTS.md
|
||||
- /Users/treyt/Desktop/code/Feels/Tests iOS/README.md
|
||||
- /Users/treyt/Desktop/code/Feels/Tests iOS/Helpers/BaseUITestCase.swift
|
||||
- /Users/treyt/Desktop/code/Feels/Tests iOS/Helpers/WaitHelpers.swift
|
||||
- /Users/treyt/Desktop/code/Feels/Shared/AccessibilityIdentifiers.swift
|
||||
Optional explicit test IDs/names from me (if provided, prioritize these):
|
||||
<PASTE_TEST_IDS_AND_NAMES_HERE_OR_LEAVE_EMPTY>
|
||||
|
||||
Implementation requirements:
|
||||
1. Use the established pattern:
|
||||
Mandatory references (read before coding):
|
||||
- /Users/treyt/Desktop/code/Feels/docs/XCUITest-Authoring.md
|
||||
- /Users/treyt/Desktop/code/Feels/AGENTS.md
|
||||
- /Users/treyt/Desktop/code/Feels/Tests iOS/README.md
|
||||
- /Users/treyt/Desktop/code/Feels/Tests iOS/Helpers/BaseUITestCase.swift
|
||||
- /Users/treyt/Desktop/code/Feels/Tests iOS/Helpers/WaitHelpers.swift
|
||||
- /Users/treyt/Desktop/code/Feels/Shared/AccessibilityIdentifiers.swift
|
||||
- Existing suites in /Users/treyt/Desktop/code/Feels/Tests iOS/ (use them for style/patterns)
|
||||
|
||||
Selection rules:
|
||||
1. If I pasted specific QA IDs/names, use those first.
|
||||
2. If fewer than 3 are provided, choose remaining from the spreadsheet.
|
||||
3. Pick the easiest automatable tests (low setup complexity, deterministic UI state, no external dependencies).
|
||||
4. Skip cases likely to be flaky or blocked (network dependency, unstable animation-only behavior, uncertain app hooks).
|
||||
5. Briefly justify why each selected test is “easy + stable”.
|
||||
|
||||
Implementation rules (do not reinvent):
|
||||
1. Reuse existing architecture only:
|
||||
- `BaseUITestCase`
|
||||
- `UITestID` / accessibility identifier selectors first
|
||||
- screen objects in `Tests iOS/Screens/`
|
||||
- wait helpers (`tapWhenReady`, `waitForExistence`, `waitForDisappearance`)
|
||||
2. Do NOT use `sleep(...)`.
|
||||
3. Do NOT rely on localized/raw text selectors as primary selectors.
|
||||
4. If needed, add missing accessibility IDs in app code and wire them into tests.
|
||||
5. Keep the test deterministic using fixture + launch flags from `BaseUITestCase`.
|
||||
6. Add screenshots at meaningful checkpoints for triage.
|
||||
- `UITestID` and accessibility identifiers
|
||||
- screen objects under `Tests iOS/Screens/`
|
||||
- wait helpers (`tapWhenReady`, `waitForExistence`, `waitForDisappearance`, etc.)
|
||||
2. No `sleep(...)`.
|
||||
3. No raw/localized text selectors as primary locators.
|
||||
4. Add missing accessibility IDs only when required, then wire them through current helper patterns.
|
||||
5. Keep tests deterministic with fixtures and launch flags from `BaseUITestCase`.
|
||||
6. Follow existing naming/style conventions from current passing tests.
|
||||
7. Add screenshots at meaningful checkpoints for triage.
|
||||
|
||||
Test setup choices:
|
||||
- Suggested suite file: `Tests iOS/<SUITE_NAME>Tests.swift`
|
||||
- Suggested test method: `test<FEATURE>_<BEHAVIOR>()`
|
||||
- Fixture to use: `<empty | single_mood | week_of_moods>`
|
||||
- Launch overrides if needed:
|
||||
- `skipOnboarding = <true/false>`
|
||||
- `bypassSubscription = <true/false>`
|
||||
- `expireTrial = <true/false>`
|
||||
Flake-resistance checklist (must satisfy):
|
||||
- Each test has deterministic starting state (fixture + launch args).
|
||||
- No arbitrary timing waits.
|
||||
- Assertions target stable identifiers.
|
||||
- Test does not depend on current date text formatting unless already stabilized by existing helpers.
|
||||
- If a new selector is needed, add app-side accessibility identifier first.
|
||||
|
||||
Validation requirements:
|
||||
1. Run targeted suite:
|
||||
- `xcodebuild -project Feels.xcodeproj -scheme "Feels (iOS)" -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -only-testing:"Tests iOS/<SUITE_NAME>" test`
|
||||
2. Report pass/fail summary.
|
||||
3. If failures occur, fix and rerun until green.
|
||||
Deliverable shape:
|
||||
- Prefer one suite file with 3 test methods, unless existing suite placement is clearly better.
|
||||
- Method naming: `test<Feature>_<Behavior>()`.
|
||||
- Keep helper logic in screen objects/helpers instead of duplicating in test body.
|
||||
|
||||
Validation gates (required before done):
|
||||
1. Run only the 3 new tests (not full suite), e.g.:
|
||||
- `xcodebuild -project Feels.xcodeproj -scheme "Feels (iOS)" -destination 'platform=iOS Simulator,name=iPhone 16 Pro' -only-testing:"Tests iOS/<SuiteName>/testA" -only-testing:"Tests iOS/<SuiteName>/testB" -only-testing:"Tests iOS/<SuiteName>/testC" test`
|
||||
2. If failures occur, fix and rerun until green.
|
||||
3. Run the same targeted command a second time to check flakiness.
|
||||
4. Only mark complete if both runs pass.
|
||||
|
||||
Output format:
|
||||
1. Files changed
|
||||
2. Why each change was needed
|
||||
3. Test run summary
|
||||
4. Any follow-up risks/gaps
|
||||
1. Selected QA test IDs/names with short reason for selection.
|
||||
2. Files changed.
|
||||
3. Key architecture decisions (how existing patterns were reused).
|
||||
4. Exact test command(s) executed.
|
||||
5. Run results for pass #1 and pass #2.
|
||||
6. Any residual risk/gaps.
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user