-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uia('uia.alert().defaultButton().tap()') command fails with an error on 8.0 simulator #558
Comments
I've reproduced this! My conclusion is that it is a bug in UIAutomation. You can verify it by running this script which doesn't involve Calabash: UIALogger.logMessage("Start");
UIATarget.onAlert = function(alertViewShown) {
UIALogger.logMessage("Saw alert view with: " + alertViewShown.buttons().length + " buttons");
return true;
};
target = UIATarget.localTarget();
app = target.frontMostApp();
UIALogger.logMessage("Tapping alert view button");
// activate your alert view
// manually or using UIAutomation
target.delay(5); //manual case
app = target.frontMostApp();
UIALogger.logMessage("app: "+app.bundleID()+ " "+ app.version());
UIALogger.logWarning("alert view: " + app.alert() + " default button "+app.alert().defaultButton());
UIALogger.logWarning("alert view: " + app.alert() + " cancel button "+app.alert().cancelButton()); output (notice that we can detect two buttons but default and cancel both return a nil element). ➜ XMSample git:(master) ✗ xcrun instruments -w "2471BD90-9A5E-484A-B31B-2B65CA39FBAE" -t "Automation" "com.xamarin.XMSample" -e UIASCRIPT alert-bug.js
2014-10-21 23:57:59 +0000 Default: Start
2014-10-21 23:57:59 +0000 Default: Tapping alert view button
2014-10-21 23:58:04 +0000 Default: app: com.xamarin.XMSample 1.0
2014-10-21 23:58:14 +0000 Warning: alert view: [object UIAElementNil] default button [object UIAElementNil]
2014-10-21 23:58:25 +0000 Warning: alert view: [object UIAElementNil] cancel button [object UIAElementNil]
Instruments Trace Complete (Duration : 30.579439s; Output : /Users/krukow/code/calabash-ios-xamarin-example/XMSample/instrumentscli8.trace) My conclusion is that this is (another) bug in UIAutomation in 8.0 and above that. Closing. Please re-open if you disagree. @jmoody could you file an rdar? |
Re-opening until I file the radar - otherwise I will forget. |
Hi! Have you already reported this to Apple? |
Works in Xcode 7. |
uia('uia.alert().defaultButton().tap()') command fails on 8.0 simulator with an error. Same command works fine in 7.1 simulator.
Environment:
Calabash 0.11.0
run_loop 1.0.9
Xcode 6.0.1
iPad Retina (8.0 Simulator)
Steps to reproduce:
iPad Retina 8.0 simulator
DEBUG=1 DEVICE_TARGET='iPad Retina (8.0 Simulator)' calabash-ios console
start_test_server_in_background
uia('uia.alert().defaultButton().tap()')
Expected result:
5. Command is executed successfully and default button is tapped in alert view
Actual result:
5. Command fails with an error
Console trace:
run_loop trace:
The text was updated successfully, but these errors were encountered: