mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
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:
1 parent
0ab5c305e3
commit
1b01bdbaf1
6 files changed
+234
-10
No files matched your search
@@ -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"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user