Skip to content

Commit 3220eee

Browse files
thymikeeclaude
andcommitted
test(ios): answer the panel fixture's label through KVC
A selector predicate reads label through KVC, and KVC caches the accessor it resolved. After an earlier test evaluated label on an XCUIElement, the fixture's fall-through called XCTest's getter instead of the stub, which resolved the fixture app's absent button. The full nightly suite reached that order; isolated runs did not. Fixes #4262 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 27d87b1 commit 3220eee

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerRequestPanelTests.swift‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ private final class LitPanelBookingProbe: NSObject {
8282
case "screen": return LitPanelBookingScreen(self === Self.darkWindow ? 1 : Self.windowDisplayID)
8383
case "exists": return true
8484
case "frame": return NSValue(cgRect: Self.elementFrame(self))
85+
// A selector predicate reads `label` through KVC, and KVC caches the accessor it resolved:
86+
// once an earlier test evaluated `label` on an XCUIElement, the original lookup calls
87+
// XCTest's getter, not the stub, and resolves the fixture's button query.
88+
case "label" where isKind(of: XCUIElement.self): return label
8589
default: break
8690
}
8791
return original(self, #selector(NSObject.value(forKey:)), key as NSString)

0 commit comments

Comments
 (0)