To assert text in some element, you should use the
constains assertion method and one of the following selector properties:
value for input elements. See information about
Selector properties in our docs.
In your example, you are using Selector based on the text
Selector(this.infoMsg).withText(data.otcResendMsg.otcInfoMsg) to find an element and then check its text
So, you can either create a selector for an element based on some properties besides text and then check its text in an assertion or check if an element exists using a selector based on text:
await t.expect(Selector('element').withText('some text').exists).ok()
If TestCafe cannot find a required element by your Selector, please take a look at our recipe in the FAQ section.