It is common to test inline errors by filling out a textfield and then clearing focus, as the validation happens after the user is done with it. In espresso that can look like:
onView(allOf(isAssignableFrom(EditText::class.java), withId(fieldViewId)))
.perform(safeScrollTo(), typeText(text), pressImeActionButton(), clearFocus())
And the equivalent of filling out the field in Compose can look like:
composeTestRule.onNodeWithTag(tag).assert(hasSetTextAction()).performTextInput(text)
How can I then clear the focus?