Add XCUITest authoring docs and templates

This commit is contained in:
treyt
2026-02-18 13:24:46 -06:00
parent 20ac1a7e59
commit 7e54ff2ef2
6 changed files with 252 additions and 1 deletions

49
uiTestPrompt.md Normal file
View File

@@ -0,0 +1,49 @@
# UI Test Prompt Template
Use this prompt when asking an agent to add or modify SportsTime UI tests.
---
You are updating SportsTime UI tests.
## Goal
- [Describe the behavior to test or fix.]
## Scope
- Update/add tests under `SportsTimeUITests/Tests/`.
- Reuse page objects in `SportsTimeUITests/Framework/Screens.swift`.
- Reuse shared setup in `SportsTimeUITests/Framework/BaseUITestCase.swift`.
- Reuse existing `TestFlows` where possible.
## Required Changes
- [List test suites to modify.]
- [List new test names.]
- [List selectors/page-object methods to add if needed.]
## Constraints
- Do not add raw sleeps unless strictly necessary.
- Prefer `waitForExistenceOrFail` and `waitUntilHittable`.
- Keep tests deterministic with current local test data.
- Keep existing naming style (`testF###_...`, `testP###_...`, etc.).
## Validation
Run these before finishing:
1. Targeted class or test:
- `xcodebuild test-without-building -project SportsTime.xcodeproj -scheme SportsTime -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' -parallel-testing-enabled NO -only-testing:SportsTimeUITests/<SuiteOrTest>`
2. Full UI suite:
- `xcodebuild test-without-building -project SportsTime.xcodeproj -scheme SportsTime -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' -parallel-testing-enabled NO -only-testing:SportsTimeUITests`
3. If requested, full scheme:
- `xcodebuild test-without-building -project SportsTime.xcodeproj -scheme SportsTime -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' -parallel-testing-enabled NO`
## Output Format
- Summarize files changed.
- Summarize root causes fixed.
- Include exact commands run and pass/fail outcomes.
- Call out any remaining flaky behavior or follow-up work.