Package-level declarations

Types

Link copied to clipboard

Утилиты для отладки и тестирования объединенного дерева

Link copied to clipboard

Класс для объединения View и Compose деревьев в единое дерево UiElement Теперь использует полиморфную структуру: ViewUiElement может содержать ComposeUiElement и наоборот

Link copied to clipboard
class UiAutomatorTreeBuilder(maxDepth: Int = 50)

Builds ApiUiNode trees via UiAutomation accessibility path only.

Link copied to clipboard
data class UiTreeAnalysis(val totalElements: Int, val viewElements: Int, val composeElements: Int, val uiautomatorElements: Int = 0, val clickableElements: Int, val textElements: Int, val elementsWithTestTag: Int, val elementsWithResourceId: Int, val maxDepth: Int, val interactiveElements: List<UiElement>)

Результат анализа объединенного дерева

Link copied to clipboard
data class UiTreeMergeResult(val tree: ApiUiNode, val statistics: TreeMergeStatistics)

Результат объединения деревьев Теперь возвращает UiElement вместо HybridUiElement

Functions

Link copied to clipboard
fun UiElement.analyze(): UiTreeAnalysis

Extension функция для удобного анализа дерева

Link copied to clipboard
fun ApiUiNode.collectWebViewNodes(): List<ApiUiNode>

Recursively collects all nodes in the subtree whose className contains "WebView". Used to find all WebView nodes under a ComposeView when merging trees.

Link copied to clipboard
fun ApiUiNode.containsWebView(): Boolean

Returns true if this node or any descendant has a className indicating a WebView. Used to decide whether to include the app's UiAutomator tree (which contains WebView HTML content).

Link copied to clipboard
fun ApiUiNode.findNodeContainingBounds(target: Bounds): ApiUiNode?

Finds the smallest node in the tree whose bounds contain (or equal) the target bounds. Returns null if no such node exists. Only considers nodes with non-null bounds. Used to find the Compose AndroidView node that corresponds to a WebView from the View tree.

Link copied to clipboard
fun List<ApiUiNode>.findWebViewByBounds(targetBounds: Bounds): ApiUiNode?

Finds a WebView node in any of the roots whose bounds match the target bounds. Used to find the corresponding WebView from appAccessibilityRoots for a WebView in View tree.

Link copied to clipboard
fun ApiUiNode.findWebViewNode(): ApiUiNode?

Finds the first node in the tree (this node or descendants) whose className contains "WebView". Used to get the WebView subtree from the Accessibility Tree to merge under the View WebView node.

fun List<ApiUiNode>.findWebViewNode(): ApiUiNode?

Finds the first WebView node in any of the roots.

Link copied to clipboard
fun getComposeTreeWithHierarchy(): List<ApiSemanticsNode>
Link copied to clipboard
fun UiElement.printToLog(tag: String = "UiTree")

Extension функция для удобного вывода дерева в лог