I'm writing some code to test IOS app using X-code and instrument. I want to check the state of a button when it toggle on/off. I try using method .isEnabled() to check if it's on/off but it fails to determine the state. In other words, instruments always passes the line "if (mainWindow.popover().buttons()[17].isEnabled())" regardless tapping the button or not.
here's part of my code:
//Button is OFF as default
//Tap to turn it ON
mainWindow.popover().buttons()[17].tap();
//Have a short delay to ensure it changes state
target.deday(1);
//Check to see if it's ON
if (mainWindow.popover().buttons()[17].isEnabled()) {
UIALogger.logMessage("button ON");
}
...