I have encountered an issue with my code:
browser.wait(ExpectedConditions.presenceOf(elementName));
Unfortunately, this often fails and only provides the vague message "expected true to be false", which is quite frustrating. When it fails, I need a more descriptive reason as to why it failed, specifically related to the elementName.
To resolve this, I want to modify the code to include a custom message. The definition of browser.wait is as follows:
wait(condition: WebElementCondition, opt_timeout?: number, opt_message?: string): WebElementPromise;
Therefore, I can update the code like so:
browser.wait(ExpectedConditions.presenceOf(element), 0, `Expected presence of ${elementName}`);
My challenge now is that I do not want to alter the opt_timeout unless absolutely necessary. Is there a way to pass the opt_message without being required to pass the opt_timeout?