馃殌 Feature Request
When locator.waitFor() do not fulfill the wait and fail we get a fairly generic error message. The error messages usually looks something like this:
Error: locator.waitFor: Target page, context or browser has been closed
Call log:
- waiting for locator('#my_fancy_locator') to be visible
...
or
TimeoutError: locator.waitFor: Timeout 10000ms exceeded.
Call log:
- waiting for locator('#my_fancy_locator') to be visible
...
Add a message option to waitFor option where we could provide a custom error message.
Example
// some code
// ...
page.locator('#my_fancy_locator').waitFor({ state: 'visible', timeout: 10000, message: 'Fancy Locator never displayed' });
This could produce this failing msg:
TimeoutError: Fancy Locator never displayed (locator.waitFor: Timeout 10000ms exceeded).
Call log:
- waiting for locator('.modal__title-row') to be visible
or we could get a similar error message structure as expects:
TimeoutError: Fancy Locator never displayed
locator.waitFor() failed
Locator: locator('#my_fancy_locator')
Waiting state: visible
Timeout: 10000ms
TimeoutError: element(s) not found
Call log:
- Fancy Locator never displayed with timeout 10000ms
- waiting for .locator('#my_fancy_locator')
Motivation
This simple change would improve the error messages and make it easier to see what has failed.
馃殌 Feature Request
When locator.waitFor() do not fulfill the wait and fail we get a fairly generic error message. The error messages usually looks something like this:
or
Add a message option to waitFor option where we could provide a custom error message.
Example
This could produce this failing msg:
or we could get a similar error message structure as expects:
Motivation
This simple change would improve the error messages and make it easier to see what has failed.