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

27
AGENTS.md Normal file
View File

@@ -0,0 +1,27 @@
# SportsTime Agent Notes
This file is for AI/code agents working in this repo.
## UI Test Docs
- Start with `XCUITest-Authoring.md`.
- Use `XCUITestSuiteTemplate.swift` when creating new suites.
- Use `uiTestPrompt.md` when asking an agent to add/fix UI tests.
## UI Test Ground Rules
- Keep new UI tests in `SportsTimeUITests/Tests/`.
- Reuse page objects in `SportsTimeUITests/Framework/Screens.swift`.
- Reuse shared setup and helpers from `SportsTimeUITests/Framework/BaseUITestCase.swift`.
- Reuse high-level flows from `TestFlows` before adding duplicate test steps.
- Prefer robust waits (`waitForExistenceOrFail`, `waitUntilHittable`) over sleeps.
- Use existing accessibility identifiers (`wizard.*`, `tripOptions.*`, `tripDetail.*`, etc.).
- Capture screenshots for key checkpoints in longer end-to-end tests.
## Before Merging UI Test Changes
- Run the touched test class.
- Run 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`
- Run full scheme verification if behavior touched shared flows:
- `xcodebuild test-without-building -project SportsTime.xcodeproj -scheme SportsTime -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' -parallel-testing-enabled NO`