iOS: XCUI test suite with a fixture/mock test mode - #25
Conversation
|
Reviewed the diff (CI workflows,
The "UI tests" step passes both Since the PR description already flags that neither workflow has run on GitHub yet, it'd be worth doing the suggested No other issues found — the mock/fixture layering, capture-dir mechanism, and accessibility-identifier additions all look correct and consistent with the stated design. |
DEBUG-only launch switches (FLYFUN_UITEST, FLYFUN_MOCK and friends) put the app on an in-memory, non-CloudKit store seeded with fixtures, sign it in without the keychain, fix airport timezones, and answer every request from a URLProtocol stub that records what the app sent. Views gain the accessibility identifiers the journeys select by, and a document's expiry state is now spoken, not carried by colour alone. Part of #24. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds the flyfun-formsUITests target and a shared scheme, with journeys for launch, new flight, flight-plan paste, a schedule edit across UTC midnight, form generation (asserting the request sent), validation errors, adding a person with a passport, and return / next leg / duplicate. CI gates PRs on the unit target and runs the journeys nightly, as flyfun-weather does. Closes #24 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The shared scheme now lists flyfun-formsUITests, which is iOS-only. An unfiltered `xcodebuild test -destination platform=macOS` builds it anyway and fails launching its runner, so the macOS pre-flight runs the unit target only. iOS keeps the whole scheme — the one place a release is sure to have passed the journeys — with a timeout that fits them, and both read the count from the result bundle instead of trusting TEST SUCCEEDED. Part of #24. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
a620f31 to
f35fde8
Compare
…green Part of #24. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code ReviewReviewed the full diff (test-mode plumbing, new Xcode UI-test target/scheme, CI workflows, XCUI journeys, and the No high-confidence bugs, CLAUDE.md violations (none exists in this repo), or design-doc deviations found. Specifically checked and confirmed correct:
Nice attention to the DST/midnight-crossing and lazy- No issues to flag. Approving. |
Code ReviewReviewed the diff (CI workflows, No high-confidence issues found. Specifically checked and ruled out:
Nice attention to detail in the fixtures/mocking design (in-memory non-CloudKit store, stubbing at the |
Closes #24
Adds the app's first UI tests, and its first iOS CI, following flyfun-weather's
flyfun-weatherUITestspattern.Test mode (DEBUG only;
Services/UITestMode.swift)FLYFUN_UITEST=1ModelContainerseeded byUITestSupport/UITestFixtures.swift, so tests never write into the simulator's iCloud account.FLYFUN_MOCK=1UITestURLProtocolanswers every request.URLSession.shared(RollingBearerSessionincluded), soFormServiceneeded no refactor, and the real decoding and 422 parsing stay under test.flightforms.api.airports.get_airport.tearDown.FLYFUN_UITEST_CAPTURE_DIR: the stub writes each request body there, so journeys assert on the request the app generated. The server's output stays covered by the Python snapshot tests.FLYFUN_UITEST_CLIPBOARD: replaces only the pasteboard read, which avoids the "Allow Paste" prompt. Parsing and apply are the real code.FLYFUN_MOCK_GENERATE=422: makes/generateanswer with a validation error.accessibilityValue), not shown by colour alone.Journeys (iPhone; macOS out of scope)
CI
ios.ymlis a PR gate that runs the unit target. It still builds the UI target, so a journey that stops compiling fails the PR.ios-ui-nightly.ymlruns the journeys nightly, with a retry and a zero-tests-ran guard, and uploads the.xcresult. It is not a gate.Verified locally
iPhone 17 simulator, Xcode 27: 103/103 tests pass (95 unit + 8 UI), with counts read from the result bundle.
Not yet verified: neither workflow has run on GitHub. They pin Xcode 26.6 like flyfun-weather's, so the first PR run will show whether the runner image works for this project. Run the nightly with
gh workflow run ios-ui-nightly.yml --ref feat/ios-ui-testsif you want it before merging.🤖 Generated with Claude Code