test(ios): answer the panel fixture's label through KVC
Summary
The panel fixture stubs label through a swizzled getter, and passes the KVC key label to the original valueForKey:. The selector predicate label ==[c] %@ reads label through KVC, and KVC caches the accessor it resolves. In the full suite, testFillIntoMaskedTextFieldIsUnverifiedRatherThanAMismatch runs first and evaluates label on a real XCUIElement. After that, the fall-through calls XCTest's real getter, which resolves app.buttons[0]. The fixture app has no button. The failure depends on test order, not on iOS 26.2. The fixture now answers KVC label for an XCUIElement by sending label to the getter installed at that moment: the stub when the probe is composed, XCTest's getter otherwise. It never uses KVC's cached accessor. A new test, testUncomposedLitPanelProbeLeavesKVCLabelReadsToXCTest, checks that an uncomposed probe leaves real elements' labels to XCTest.
1 file changed (fixture plus one test). Fixes #4262.
Not fixed here: testInAppBackOnTheSoleScreenReportsATapThatChangedNothingAsUnavailable (RunnerTests+NavigationTests.swift:65) has a different cause. Two real screen captures differed after a tap on nothing (IN_APP_BACK_VISUAL_VERIFICATION … changed=yes). It does not use this fixture, and it passed in run 42390630488 but failed in run 42394725350. It also failed on main in nightly 42338987297, so it is an existing intermittent failure that this PR does not cause. It is tracked in #4322.
Validation
Local, iPhone 17 Pro Max on iOS 27.1, testFillInto… followed by both panel tests:
- base
27d87b1f99:testLitPanel…fails atRunnerRequestPanelTests.swift:87with the CI error (Find the Button (Element at index 0)). - head
3220eeed4c: 3/3 pass.testFillInto…plus all 25 tests inRunnerRequestPanelTests.swift: 26/26 pass.
CI, XCTest Nightly on iOS 26.2: before is run 42338987297 (main, failed). After is run 42390630488 (this branch, 3220eeed4c): success on both legs. iPhone: 664 tests, 0 failures, 2 skipped. Both panel tests pass.
CI, XCTest Nightly on head 849905f2bc (run 42394725350): iPad leg success. iPhone leg: 665 tests, 2 skipped, 1 failure, the intermittent navigation test above. All panel tests pass, including the new one. PR checks: 17/17 pass on 849905f2bc.
Gate: pnpm check:affected --run --head 849905f2bc passed (receipt run-Gihua7), exactCommit=true (native-dupes, xctest-selection, packaged-runner-swift; Swift lanes are GitHub-owned).
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.