asserting-node-state-and-text

Assert Jetpack Compose semantics node visibility, interactivity, and text properties.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill asserting-node-state-and-text-trancee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asserting-node-state-and-text
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/android-testing-skills/compose/assertions/asserting-node-state-and-text
Command: npx skills add https://github.com/trancee/MeshLink-template --skill asserting-node-state-and-text-trancee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the ambiguity between checking if a UI element exists in the semantics tree versus whether it is actually visible to the user, while providing a standardized way to assert node properties without bypassing framework error reporting.

Core Features & Use Cases

  • Typed Assertions: Provides direct access to framework-native assertions like assertIsDisplayed, assertIsEnabled, and assertTextEquals.
  • Collection Validation: Simplifies verifying list cardinality and state across multiple nodes using assertCountEquals, assertAny, and assertAll.
  • Use Case: Use this skill when you need to verify that a specific button is enabled and visible after a state change, or to ensure a list contains exactly three items, ensuring that failure messages include helpful node dumps and selector descriptions.

Quick Start

Use the asserting-node-state-and-text skill to verify that the submit button is displayed and enabled on the current screen.

Frequently Asked Questions about asserting-node-state-and-text

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

FAQPage Schema
How do I check if a Jetpack Compose UI element is actually visible and not just present in the semantics tree?

To check Jetpack Compose UI visibility, use typed SemanticsNodeInteraction assertions like assertIsDisplayed. This verifies the element is actually visible to the user and ensures failure messages include helpful node dumps.

How do I assert that a Jetpack Compose button is enabled and displayed after a state change?

Assert a Jetpack Compose button is enabled and displayed by applying typed assertions like assertIsEnabled and assertIsDisplayed to your SemanticsNodeInteraction. This ensures framework-compliant error reporting when verifying state changes.

Can I verify the exact number of items in a Jetpack Compose list during UI testing?

You can verify Jetpack Compose list cardinality using the assertCountEquals assertion. This validates that your semantics nodes collection contains exactly the specified number of items, ensuring accurate state validation across multiple nodes.

How do I validate text content of a Jetpack Compose component in UI tests?

Validate Jetpack Compose component text content using the assertTextEquals assertion on a SemanticsNodeInteraction. This framework-native approach inspects node properties directly and provides standardized error reporting if the text does not match.

Does asserting Jetpack Compose semantics node state provide helpful messages when tests fail?

Asserting Jetpack Compose semantics node state provides helpful failure messages. Typed assertions ensure framework-compliant error reporting that includes detailed node dumps and selector descriptions to aid debugging.

What is the best way to assert multiple Jetpack Compose nodes match a condition simultaneously?

The best way to assert multiple Jetpack Compose nodes match a condition is using assertAll. This collection validation ensures every node in a SemanticsNodeInteraction collection satisfies the specified state or property requirement.