Protractor + ionicPopup

Has anyone succeeded in using Protractor to detect an ionicPopup alert? I've tried all the workarounds suggested here but no luck. I need Protractor to detect the alert and check the text in the alert.

Ionic Popups are just made of DOM elements, so you should be able to use normal locators to find/test them. Because they're not made of alerts, the workarounds in the issue you linked to are probably not useful.

I got it - I saw a lot of issues out there trying to do it in very complex ways, but in the end I tried this and it turns out to be this simple.

Inspect your element and find its ng-repeat value, then

var button = element(by.repeater('button in buttons')).getText()

You also need to have the browser sit out somehow for a couple seconds so it doesn't resolve to the tests while the ionic popup isn't actually there.

For that, browser.sleep(3000);

That's it! However, getting the other button in there is proving to be a little problem. var button = element(by.repeater('button in buttons')).get(0) or .get(1) return undefined is not a function.

Please accept the answer if you like it! If I figure out how to get the other button, I'll post it here.