More descriptive errors for element.all(locator) when waitForAngular fails. #2996
Description
Feature Request:
tl;dr: Add the locator to error messages in waitForAngular.
If the waitForAngular call times out when calling element.all(locator) we get an error message like the following:
Timed out waiting for Protractor to synchronize with the page after 9 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md. The following tasks were pending: - $timeout: function o(){var e=n&&n.$$destroyed,t=e?[]:r.queue,o=e?null:r.digest;r.queue=[],r.timeout=null,r.digest=!1,t.forEach(function(e){e()}),o&&d.$digest()}
Unfortunately, we don't have any information about the specific locator which initiated the waitForAngular call. Should be easy enough to pass the locator as the description here:
https://github.com/angular/protractor/blob/master/lib/element.js#L133
I would love to have an error message like this:
Timed out waiting for Protractor to synchronize with the page after 9 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md. Locator: by.css('.parent'). The following tasks were pending: - $timeout: function o(){var e=n&&n.$$destroyed,t=e?[]:r.queue,o=e?null:r.digest;r.queue=[],r.timeout=null,r.digest=!1,t.forEach(function(e){e()}),o&&d.$digest()}
- Reasons for adopting new feature
Improve error clarity and ease of debugging. - Is this a breaking change? (How will this affect existing functionality)
No. Should be really easy to implement too!