Summary of changes
Two changes in the first commit, then the commits that the suite and voice needed.
Tests no longer raise system permission prompts. LaunchMode names how the app was started (interactive, scripted with a -poki… argument, or under XCTest). Scripted and XCTest launches skip the notification, speech, microphone and location authorization dialogs and still register notification actions. Suite state that leaked between tests is reset (the in-process open gate, the automation boot marker, wantsOn, the pasteboard), and scripts/app-tests.sh copes with PTY carriage returns, takes an optional DerivedData path and launch arguments, and prints the console tail on failure.
A task start no longer turns Poki on. AppModel.prepareForTask() used to start a phone automation session when none was running, so a task that only reads a website still raised iOS's "Enter iPhone passcode for XCTest" style prompt. It now only wakes a session that is already on. The first phone step still turns Poki on, through one function (AppModel.turnOnForPhoneStep) that a chat task's look or do (runTool) and a live voice conversation's look, do or open_app (voicePhoneStep) both use. A task that starts on a web page and then needs another app works as before, and voice works with Poki switched off. The flag that carried a pending start across the disk image check (pendingPrepareForTask) had no setter left and is removed.
The follow-up commits:
VoiceModelTestsdid not compile onmain(aphoneToolclosure in one test returned a two-field result after #496 and #498 landed). One argument added.- Live Activity tests suspend Poki to test finish notices and left it in the background, so later suites (voice, Talk Here) ran in a backgrounded app and failed. Their
tearDownnow brings Poki back to the front.
Motivation
The app tests need to finish on a fresh simulator. On main plus the compile fix, a full run on an erased iPhone 17 Pro (iOS 27.0) has 14 failing tests, among them testWikipediaTaskKeepsPhoneAutomationOff ("A website task must not start phone automation") and four LiveActivityTests. The failures come from system prompts on a fresh simulator and from state shared between suites. Landing the fix on its own keeps it out of the CI workflow change in #481.
Test plan
Simulator only, no physical iPhone. native/ios-app/scripts/app-tests.sh on a freshly erased iPhone 17 Pro, iOS 27.0, through the build queue, on the base of 97876be7, full run on the head commit.
- Before (
mainplus only theVoiceModelTestscompile fix): 318 tests, 14 failing, includingtestWikipediaTaskKeepsPhoneAutomationOff,ChatHarnessTests.testSplitViewStopWhileWaitingDoesNotResumeWhenThePairReturnsand fourLiveActivityTests. - After (this branch, head 0358ddd4): 323 tests, 3 failing, all of which also fail on
main:InterfaceSizeTests(two slider tests) andVoiceLanguageTests.testTheLiveSessionSpeaksTheUsersLanguageAfterEnglishToolResults(the live voice prompt text no longer matches the assertion). They are not touched here. - New test
InProcessPasscodeTests.testABrowserTaskThatNeedsAnotherAppTurnsPokiOnForThatStep: a chat task opens a web page, then needs Settings. Poki is off through the task start and the page, and on after the phone step. It fails with the oldprepareForTask()(Poki on at every request) and passes now. - New test
testALiveVoicePhoneStepTurnsPokiOnWhenItIsOff: with Poki switched off, a live voice phone step turns Poki on. Without the change the step waited on "runner: starting" and Poki stayed off (red), now it passes. - Not verified: a physical iPhone, where iOS shows the real passcode prompt. The behavior change is that this prompt now appears at the first phone step instead of at task start.
Screenshots or screen recording
N/A
AI assistance: Claude Code. I have reviewed and understand these changes.
- I removed passcodes, tokens, and private screen contents from this PR.
- I release this contribution under the AGPL-3.0-only license.