Add XCUITest authoring docs and reusable prompt template
This commit is contained in:
53
uiTestPrompt.md
Normal file
53
uiTestPrompt.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# UI Test Prompt Template
|
||||
|
||||
Copy/paste this prompt into Codex or Claude and replace the placeholders.
|
||||
|
||||
```md
|
||||
Create an iOS UI test for this behavior:
|
||||
|
||||
<DESCRIBE USER FLOW / EXPECTED BEHAVIOR>
|
||||
|
||||
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
|
||||
|
||||
Implementation requirements:
|
||||
1. Use the established pattern:
|
||||
- `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.
|
||||
|
||||
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>`
|
||||
|
||||
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.
|
||||
|
||||
Output format:
|
||||
1. Files changed
|
||||
2. Why each change was needed
|
||||
3. Test run summary
|
||||
4. Any follow-up risks/gaps
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user