refactor(companion): tidy snapshot serialization

This commit is contained in:
pj committed 2026-06-07 15:59:15 +05:30
1 parent 1cc820637e
commit 629194015d
2 files changed
+14 -11

No files matched your search

+1 -4
View File
@@ -31,7 +31,7 @@ enum Snapshot {
private static func serialize(_ node: XCUIElementSnapshot) -> [String: Any] {
let frame = node.frame
var element: [String: Any] = [
return [
"type": elementTypeName(node.elementType),
"frame": [
"x": Double(frame.origin.x),
@@ -44,9 +44,6 @@ enum Snapshot {
"AXValue": nullableString(stringifyValue(node.value)),
"AXUniqueId": nullableString(node.identifier),
]
// Keep the dictionary keys deterministic for readers; values stay as set.
_ = element
return element
}
private static func nullableString(_ value: String?) -> Any {