I’ve been trying to write end-to-end tests for my Ionic app. I’m having trouble detecting when the side menu is opened or closed. I’m using Protractor for tests.
Here’s what I have:
expect(element(by.tagName('ion-side-menu')).isDisplayed()).toBe(true);
// close menu
groupsPage.toggleGroups();
expect(element(by.tagName('ion-side-menu')).isDisplayed()).toBe(false);
The side menu clearly closes. However the value of isDisplayed() always returns true. I have even tried delaying the second test inside a then() callback to make sure there were no timing issues
Has anyone successfully queried the state of a side menu for this kind of test?