Composables UI is out: our new component library for Compose Multiplatform ->
Function

assertContentDescriptionEquals

Asserts that the node's list of content descriptions contains exactly the given values and nothing else.

assertContentDescriptionEquals

Source set: Common
fun SemanticsNodeInteraction.assertContentDescriptionEquals(
    vararg values: String
): SemanticsNodeInteraction

Asserts that the node's list of content descriptions contains exactly the given values and nothing else.

The ContentDescription property is represented as a list of strings. In the merged semantics tree (the default in Compose testing), this list often contains multiple descriptions merged from child nodes. This function evaluates the entire list.

The assertion will only pass if the node's list contains all the provided values, and contains no additional items. Note that the order of the elements does not matter.

Typically, accessibility tooling will decide based on its heuristics which descriptions to announce.

Throws AssertionError if the node's descriptions don't contain all items from values, or if the descriptions contain extra items that are not in values.

Parameters

values List of values to match (the order does not matter).

Last updated: