mardi 29 octobre 2019

How to make a test in Espresso that checks a string that contains HTML tag?

I am doing some UI testing on an android Fragment and I have the following string in my code:

textView.text = Html.fromHtml("$updateText <u>Change</u>?")

And in my test I have this code:

recoverPasswordAssert{

    checkTextIsVisible("Number format. Change?")
}

When I run the test this error happens:

androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with text: is "Number format. Change?"

I think it's missing the HTML tag from the fragment code, but how to get the tag in the Espresso test?

Aucun commentaire:

Enregistrer un commentaire