feat(ios): derive scrollable from the snapshot's tree depth

the companion now emits each node's depth, so the hierarchy mapper can find the containers that clip content reaching past their own frame and mark them scrollable:true, the same fact android reads off uiautomator and the web driver derives from overflow. a dump without depth makes every element a root and roots are never marked, so the legacy bridge reports no scroll rather than a guessed one.
This commit is contained in:
pj committed 2026-08-16 17:41:49 +05:30
1 parent 0ab5c305e3
commit 1b01bdbaf1
6 files changed
+234 -10

No files matched your search

+11 -3
View File
@@ -482,6 +482,11 @@ const iosAttrDump = `{
"attributes": {"accessibilityText": "Close", "title": "Settings", "bounds": "[0,0,100,50]"},
"children": [],
"enabled": true
},
{
"attributes": {"identifier": "Feed", "scrollable": "true", "bounds": "[0,120,390,700]"},
"children": [],
"enabled": true
}
]
}`
@@ -548,11 +553,14 @@ func TestTitleReturnsNilForAndroid(t *testing.T) {
}
}
func TestScrollableGracefulIgnoreOnIOS(t *testing.T) {
func TestScrollableMatchesOnIOS(t *testing.T) {
tree, _ := Parse(iosAttrDump)
el := tree.Find("scrollable:true")
if el != nil {
t.Fatal("expected scrollable:true to return nil on iOS hierarchy (graceful ignore)")
if el == nil {
t.Fatal("expected scrollable:true to match the iOS scroll container")
}
if el.Attributes["identifier"] != "Feed" {
t.Fatalf("got %q, want Feed", el.Attributes["identifier"])
}
}