composing-semantics-matchers

Compose SemanticsMatcher predicates for precise Android UI node queries.

303|10|Updated May 15, 2026
One-click install
npx skills add https://github.com/skydoves/android-testing-skills --skill composing-semantics-matchers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: composing-semantics-matchers
Source: https://github.com/skydoves/android-testing-skills/tree/main/compose/finders/composing-semantics-matchers
Command: npx skills add https://github.com/skydoves/android-testing-skills --skill composing-semantics-matchers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents brittle Compose UI tests by replacing multiple chained assertions with a single, precise SemanticsMatcher that targets the correct node and produces a clear, clause-by-clause failure message.

Core Features & Use Cases

  • Composable matcher algebra: Build one SemanticsMatcher using infix and, infix or, and operator not so failures explain exactly which constraints were not met.
  • Rich prebuilt semantics filters: Combine built-in matchers like hasText, hasClickAction, isEnabled, isOn, hasTestTag, hasContentDescription, and many more.
  • Hierarchical matching: Express relationships using hasParent, hasAnyAncestor, hasAnyChild, hasAnySibling, and hasAnyDescendant to avoid incorrect “direct child” assumptions.
  • Custom semantics keys: Match domain-specific SemanticsPropertyKey values using SemanticsMatcher.expectValue, SemanticsMatcher.keyIsDefined, and SemanticsMatcher.keyNotDefined.

Quick Start

Use the composing-semantics-matchers skill to write one onNode query that combines text, state, actions, and (if needed) ancestor/descendant constraints into a single SemanticsMatcher.

Frequently Asked Questions about composing-semantics-matchers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I match a Jetpack Compose UI node with multiple constraints in one query?

Compose a single SemanticsMatcher using infix and, infix or, and operator not to combine prebuilt filters like hasText, isEnabled, and hasClickAction, producing a clear failure message for each unmet constraint.

What's the best way to write Jetpack Compose UI tests for hierarchical node relationships?

Use hierarchical SemanticsMatcher functions like hasParent, hasAnyAncestor, hasAnyChild, and hasAnyDescendant to express node relationships precisely and avoid incorrect direct-child assumptions during Compose UI testing.

Can I filter Compose UI test nodes by custom semantics keys?

Yes, you can match domain-specific SemanticsPropertyKey values using SemanticsMatcher.expectValue, SemanticsMatcher.keyIsDefined, and SemanticsMatcher.keyNotDefined to filter custom semantics keys in Compose UI tests.

Why do my Compose UI tests fail with brittle chained assertions?

Chained assertions often fail because they target multiple nodes instead of the correct one; replacing them with a single precise SemanticsMatcher prevents brittle Compose UI tests and generates clear, clause-by-clause failure messages.

Does SemanticsMatcher support combining text and state filters for Android Compose testing?

Yes, SemanticsMatcher supports composable matcher algebra, allowing you to combine text filters like hasText with state filters like isOn and isEnabled into one onNode query for Android Compose UI testing.