So, i am trying to create a custom function that will allow me to check if a field contains a number or a text, but for further test i will need to check more complex stuff, like if the sum of some table equals something, etc. I can't find examples of custom functions for example:
function isNumber(n) {
let a = parseInt(n);
if (a > 0 || a < 0) {
return true
}
return false
}
test('Test example', async t => {
await t
.expect(isNumber(Selector('#thisNum').innerText)).ok('This is a number' );
});