Protractor: Get text of an alert?
问题 I'm testing my Angular app with Protractor. I've looked through the docs and can't find any way to get the text of an alert. It's not an element in the DOM per se (at least, not that I can figure out; when there's an alert up, Chrome's inspector won't allow you to inspect it). How would I test that an alert has the correct message? Or even, that one is present? Edit Here is my code. HTML: <button id='alertButton' data-ng-click='ngAlert()'>Button</button> JS: $scope.ngAlert = function(){