---
title: "assertTextEquals"
description: "Asserts that the node's text contains exactly the given [values] and nothing else.

This will also search in [SemanticsProperties.EditableText] by default.

Note that in merged semantics tree there can be a list of text items that got merged from the
child nodes. Typically an accessibility tooling will decide based on its heuristics which ones to
use.

Throws [AssertionError] if the node's text values don't contain all items from [values], or if
the text values contain extra items that are not in [values]."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun SemanticsNodeInteraction.assertTextEquals(
    vararg values: String,
    includeEditableText: Boolean = true,
): SemanticsNodeInteraction
```


Asserts that the node's text contains exactly the given `values` and nothing else.

This will also search in `SemanticsProperties.EditableText` by default.

Note that in merged semantics tree there can be a list of text items that got merged from the
child nodes. Typically an accessibility tooling will decide based on its heuristics which ones to
use.

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

#### Parameters

| | |
| --- | --- |
| values | List of values to match (the order does not matter) |
| includeEditableText | Whether to also assert against the editable text. |




