fix(hierarchy): reach a web test tag through testTag and testID

Compose for Web writes a test tag as data-testid, which is what the web
runtime resolves both names against. testTag aliased onto the three
identifier keys and not that one, and testID aliased onto nothing at
all, so a tag the web runtime found on every row of a list named no
element here and every property over it passed vacuously.
This commit is contained in:
pj committed 2026-08-19 10:07:00 +05:30
1 parent ae629d9d7d
commit 1bcbb8b7e8
2 files changed
+42 -2

No files matched your search

+5 -2
View File
@@ -274,8 +274,11 @@ var attributeAliases = map[string][]string{
// iOS identifier names
"identifier": {"resource-id", "accessibilityIdentifier"},
"accessibilityIdentifier": {"resource-id", "identifier"},
// Compose testTag surfaces as resource-id on Android, accessibilityIdentifier on iOS
"testTag": {"resource-id", "identifier", "accessibilityIdentifier"},
// Compose testTag surfaces as resource-id on Android, accessibilityIdentifier
// on iOS and data-testid on web, which is the key the web runtime resolves
// both names against.
"testTag": {"resource-id", "identifier", "accessibilityIdentifier", "data-testid"},
"testID": {"data-testid"},
// iOS AXElement raw name for hintText
"placeholderValue": {"hintText"},
// iOS AXElement raw name for class