Repository navigation
Apple driver: SwiftUI's identifiers, multi-line fields, dismiss, turned windows, late presentations, scene phase; launchers fresh, prompt to stop, with arguments - #231
Merged
Conversation
…wn elements, multi-line fields' labels, dismiss and back closing sheets, taps in a turned window, settling for a late presentation; launchers that start fresh, stop at once, pass arguments and turn pictures
… Mac, deletes its defaults through cfprefsd (CFFIXED_USER_HOME doesn't move them); a kept launch sees the data a fresh one left; taps fall back to the element's own cell
…t for sure (iOS, Android, the Mac)
…ain when GitHub's image takes it down (actions/runner-images#15334), then try again what failed
…aving it and coming back does (headless.proto, iso, HeadlessApp.scene); Isomer's runtime's phase, SwiftUI's scene delegate on iOS, hidden or in the Dock on the Mac, Android's launcher through the activity's lifecycle; the probe's scene screen and its test
…rm's way of moving the scene
AttilaTheFun
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gaps an app's UI tests found driving its app headful on an iPhone simulator through Isomer's Apple driver, and on an Android emulator. For 0.56.
The Apple driver (drive/apple)
AccessibilityNodes, which answeraccessibilityIdentifierwithout declaringUIAccessibilityIdentification, so the driver's cast found nothing where XCUITest, which asks the selector, finds them all. The driver now asks the selector (AccessibilityScreen.identifier).TextField(aUITextView) is labelled by its placeholder: accessibility's placeholder value while it is empty, else the placeholder label it keeps hidden once there is text, else its identifier.dismisscloses the topmost presentation: escape first; else a sheet a person may swipe away, closed as the swipe closes it (its presentation controller's delegate asked and told, so SwiftUI'sisPresentedandonDismissfollow; not whenisModalInPresentation); else its own Cancel, Close or Done.backat a sheet's first page closes the sheet, as Isomer's driver does.UIAccessibility.convertToScreenCoordinates, inverted), not throughUIScreen.coordinateSpace; where that point reaches nothing that takes a tap, the element's accessibility containers lead to its cell or control.infosays how the interface stands (Info.orientation, new in headless.proto).ls,info,inspectandquitanswer with the reading they settled on instead of settling twice.ISO_DRIVE_TRACE=1prints the driver's walk of the tree.Launchers and HeadlessApp
quit()'sstopfile (requests.sh, browser_check), andquit()also sends SIGTERM at once off Windows, so it no longer waits 10 s.HeadlessApp(launcher:environment:arguments:fresh:timeout:),fresh: trueby default (the launcher'sISOMER_FRESH=1): a test's app starts with none of its data from before, as an app built headless does. The default is on because that is what the same test gets headless and on the web, and a test that wants data kept is the exception. iPhone: the app's defaults are deleted through the simulator's cfprefsd by each plist's path (deleting them by name reaches the simulator's own domain, and a file removed under cfprefsd comes back), then its files and its app groups', and the simulator's keychain is reset. Android:pm clear. Mac: its defaults are deleted (cfprefsd keeps them in the user's real home whateverCFFIXED_USER_HOMEsays, so the Mac launcher's home of its own never isolated them) and its home is emptied. Linux: its home (HOME, XDG_*) is emptied. Web: a new browser profile every launch anyway.fresh: falsekeeps the data. Windows keeps it for now.<launcher> <hub> <name> [KEY=VALUE…] [-- <argument>…]: the iPhone's through simctl, the Mac's and Linux's on the command line, Android's asISO_ARGUMENTS;HeadlessApp(…, arguments:).picturenames Android'sphone-landscapein a wide window, as the iPhone's. The iPhone's launcher turns a picture of an app that turned itself to landscape on an upright simulator (the request carries the driver's orientation;sips, only when the frame is upright).pictureno longer asks for the screen twice: about 0.6 s a picture on the iPhone, down from 1.7 s.<name>.log).HeadlessAppreleased withoutquit()(a test that threw first) stops its launcher.iso launch <launcher> [--name <name>] [--keep-data] [KEY=VALUE…] [-- <argument>…]andiso launch stop <name>: a launcher run in the background, its app dialling the CLI's hub.Scene phase:
scene <active|inactive|background>A driver command (headless.proto's
scene, its phase invalue),iso scene <phase>andHeadlessApp.scene(.background | .inactive | .active): the app's scene phase moved as leaving the app and coming back does, so what an app does on.onChange(of: scenePhase)(a sign-in prompt on return) runs under test.Runtime.setScenePhase).sceneWillResignActive,sceneDidEnterBackground,sceneWillEnterForeground,sceneDidBecomeActive), with UIKit's scene and application notifications posted after each. Tried on an iPhone 17 simulator (iOS 27.2) with a one-file SwiftUI app: the delegate calls movescenePhasethrough inactive, background, inactive, active, and the app stays on screen and driven; posting the notifications alone moves nothing; a real trip home (another app launched by simctl, thensimctl launchagain, which brings the same process back) works too but takes about 7 s to reach background and suspends the app, so its driver can't answer meanwhile.NSApp.hide), inactive its windows in the Dock, active shown and brought to the front. Tried the same way: hiding gives background, miniaturizing inactive; deactivating the app alone leaves SwiftUI's phase active.HeadlessApp.scene(andiso scenefor an appiso launchstarted) asks the launcher first (requests.sh'sscene:<phase>request, answered in<n>.answer): android_launcher.sh sends the app home (KEYCODE_HOME: paused, stopped) and brings it back witham start(the singleTask activity's task brought to the front, the same activity and process: onRestart, onStart, onResume), waiting until it is stopped or resumed. Inactive has no such way, nor has any other launcher: the driver's command does it (a launcher that doesn't take the request removes it unanswered, or answers why not).DriverProbeTests.sceneLeavesAndComesBack(headless, and headful on the iPhone through the iOS launcher);StorybookHeadlessTests.comesBackFromTheBackground(a story's state kept across a trip to the background, the app still driven) on every platform the Storybook's tests run on, Android's launcher way included.CI: GitHub's xcode-27 image 20261112.0361.1
The first verify run's
apple (ios)andapple (pictures)failed because CoreSimulator went down under them partway through: everysimctlafter that answeredCoreSimulatorService: Connection interrupted. On the iPhone, 6 of the Storybook's 17 tests and all 16 of the probe's then failed at launch; on the pictures job, 9 stories didn't launch. Both jobs ran on image 20261112.0361.1, and earlier runs on 20261104.0337.1 passed. The new image adds Xcode 27.3 beta and macOS 27.2, and has simdiskimaged unmount an iOS runtime it mounted twice while a simulator runs from it (actions/runner-images#15334, #14946).apple (macos)andapple (hosted)don't depend on a simulator surviving long, and passed.tools/ci/hosted_simulator.sh, sourced by hosted_apple_test.sh and hosted_headful_test.sh:
simctl runtime list -j) before it makes the simulator;--filter), at most twice;A test that fails while the simulator is up still fails.
Tests
//apple/driver_probe_ios_applicationbuilds the probe twice: upright, and landscape-only (:driver_probe_landscape_ios_application). New screens: a Form (identified controls in rows, a field, a multi-line field, a principal title button) and sheets (one with only Done, one with nothing but a swipe, one over another).DriverProbeTestsrun headful through the iOS launcher (:driver_probe_headful_apple_runner). New tests: form identifiers, the multi-line field's label, dismiss, a sheet over a sheet, launch arguments, fresh and kept launches, an app turned to landscape (taps, back,info, the picture turned), and a selection row's tap in landscape..ci/platforms/headful/probe).hosted_headful_test.sh appleinstalls them on the job's simulator and runs them in itsiospart. No workflow change is needed: the existingheadful-apps-appleartifact carries the folder.StorybookHeadlessTests.aLaunchStartsFreshUnlessAskedToKeep(state.appstorage's stars) runs on every headful platform that has a launcher.Verified
On a macOS VM with Xcode 27.2, on an iPhone 17 simulator (iOS 27.2), with the apps built there with
--@isomer//drive:headful:--to the app's command line (checked withps), and ends the app on thestopfile alone.infoandls0.3 s, quit 0.45 s.The selection row's tap in landscape passed with the old coordinate mapping as well, so that failure isn't reproduced by the probe. The new mapping is exact by construction, and the container fallback doesn't depend on coordinates.