I'm using TestCafe for all my web tests and things were working fine until some configuration files were updated in the web project with some app cues to work. Most of the tests fail but not all which makes it really tricky to figure out what is the problem.
Here is the problem:
A function that specifies a selector can only return a DOM node, an array of nodes, NodeList, HTMLCollection, null or undefined. Use ClientFunction to return other values.
Browser: Chrome 78.0.3904 / Mac OS X 10.14.6
47 | return Selector('div').withExactText('Project').nextSibling().find('div')
48 | .find(`${this.headLocator}.${Name}`);
49 | }
50 |
51 | async BreakDownCount(Name) {
> 52 | return helper.getIntFromString(await this.BreakdownLocator(Name).textContent);
Here is the code:
BreakdownLocator(Name) {
return Selector('div').withExactText('Project').nextSibling().find('div')
.find(`${this.headerLocator}.${Name}`);
}
async BreakDownCount(Name) {
return helper.getIntFromString(await this.BreakdownLocator(Name).textContent);
}
I have a feeling that it fails where I use async functions or promise as there are other tests that didn't fail but they don't have promise. I looked around and found this discussion but this didn't help. Any suggestions?