how can I add custom validation and return true in testim?
hello,
I tried to add custom validation on my Testim steps to validate if an element is not visible return true and pass the steps. but the steps always fail even the element not found.
how can i add my custom code to testim to check if element or text not visible return true.
scenario: when user enter incorrect user credential and click log in the step checks if the user name visible return false else return false and make the step pass.
here is my solution but it doesn't work.
1.var visible = await testController.isVisible('#validcustomer');
if (!visible) {
console.log('Customer not found; test is pass');
return true;
} else {
console.log('Labels are visible');
return false;
}
- var visible= validcustomer.IsVisible;
if (!visible) {
console.log('Customer not found; test is pass');
return true;
} else {
console.log('Labels are visible');
return false;
I used HTML params.
thank you.