I’m using Detox to test my react native app. I identify my text element by the id and want to assert that the text contains SOME text.
I only want partial text check which .toHaveText("blah")
doesn’t allow.
The element has text 0 minutes / X minutes
, I purely want to check that the element contains 0 minutes
and im not interested in the X minutes
(more specifically this second bit can change and my test will fail if i try to predict what X will be)
Am i missing something ?
.toHaveText
checks the whole string, I just want to check part of the string
Aaron Barnes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.