Function

performFirstLinkClick

For a first link matching the predicate performs a click on it.

touchInputOnFirstSpecificLinkInText

@Sampled
fun touchInputOnFirstSpecificLinkInText() {
    // Example of clicking on a link in test
    composeTestRule.onNodeWithText("YOUR_TEXT_WITH_LINK").performFirstLinkClick {
        (it.item as? LinkAnnotation.Url)?.url == "YOUR_URL"
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: