mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
docs+folio: use native boolean for focused selector and document typed attrs
This commit is contained in:
1 parent
7352717d56
commit
55b5861395
2 files changed
+4
-2
No files matched your search
@@ -64,11 +64,13 @@ Pass an object to apply multiple attribute filters with AND semantics:
|
||||
|
||||
```ts
|
||||
s.ax.find({ accessibilityText: "LoginScreen" })
|
||||
s.ax.find({ accessibilityText: "account_card", clickable: "true" })
|
||||
s.ax.find({ testTag: "AccountCard", clickable: true })
|
||||
```
|
||||
|
||||
Every key-value pair must match. Substring and boolean rules apply per attribute.
|
||||
|
||||
Known attribute names are typed; you get autocomplete on `testTag`, `text`, `content-desc`, the boolean states (`clickable`, `enabled`, `focused`, `checked`, `selected`), and the cross-platform aliases (`identifier`, `accessibilityIdentifier`, `accessibilityText`, `accessibilityLabel`, `label`, `resource-id`, `class`, `elementType`, `package`, `placeholderValue`, `hintText`). Boolean state attributes accept a native `true` / `false`. Other attribute keys still type-check as a string-valued fallback so raw driver attributes remain reachable.
|
||||
|
||||
### Path queries
|
||||
|
||||
Chains of string selectors separated by ` > ` scope each segment to the subtree of the previous match. Path queries are only supported on the tree root (`ax.find`, `ax.findAll`), not on element-scoped `.find`/`.findAll`.
|
||||
|
||||
@@ -58,7 +58,7 @@ const ledgerRows = extract<LedgerRow[]>(s =>
|
||||
const ledgerBalance = extract(s =>
|
||||
parseDollarCents(s.ax.find({ testTag: "LedgerBalance" })?.text));
|
||||
|
||||
const focusedFieldTag = extract(s => s.ax.find({ focused: "true" })?.id ?? null);
|
||||
const focusedFieldTag = extract(s => s.ax.find({ focused: true })?.id ?? null);
|
||||
|
||||
const loginEmailField = extract(s =>
|
||||
s.ax.find([{ testTag: "LoginScreen" }, { testTag: "LoginEmail" }]));
|
||||
|
||||
Reference in new issue
Block a user