I am currently working on a feature that involves determining whether a logged-in user is a customer of a specific company. In the interface, there is a div that displays the manager ID if the user logging in is a manager, otherwise it redirects them to the login screen. I need to implement conditional testing to check if the account ID belongs to a customer or a manager and take different actions based on the result. However, when the test fails, instead of returning a false result, it gets stuck waiting for an answer.
.then(browser.executeScript('return window.find("isCompany:true");')),
.then(function () {
return expect(browser.wait(EC.textToBePresentInElement(element(by.id("url")), qr), wait)).toBe(true);
}, function () {
....
});