calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

App locks up if UIAlertView appears after set_location is called #95

Closed vocaro closed 11 years ago

vocaro commented 11 years ago

Calling the Calabash API method set_location, and then displaying a UIAlertView in the app under test, causes the app to freeze. (Tapping the button to dismiss the alert view does nothing.)

To reproduce in Calabash 0.9.126 with calabash-ios-example:

  1. Add a button handler to LPFirstViewController:

    - (IBAction)login:(id)sender {
       UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil
                                                       message:@"this is an alert"
                                                      delegate:nil
                                             cancelButtonTitle:@"OK"
                                             otherButtonTitles:nil];
       [alert show];
    }
  2. Link the Login button's Touch Up Inside to the handler.
  3. Launch the app.
  4. Launch the Calabash console and do: set_location(latitude: -17.884659, longitude: -5.099488). Any parameters should work here.
  5. Wait a few moments.
  6. Tap Login.

At this point, you should see the alert view, but clicking on it does nothing.

krukow commented 11 years ago

Follow-up: https://groups.google.com/d/msg/calabash-ios/gMix06zDJb0/Mf2-lvDZCRsJ

aik1771 commented 11 years ago

set_location(latitude: 40.705042, longitude:-74.010588) NameError: undefined local variable or method set_location' for main:Object from (irb):2 from /Users/agolubev1/.rvm/rubies/ruby-1.9.3-p327/bin/irb:16:in

'

krukow commented 11 years ago

Fixed (workaround) with 0.9.150 - use uia_set_location: https://groups.google.com/d/msg/calabash-ios/xmapoKqTIBc/gFQeRKltZyIJ

Harani-me commented 9 years ago

UIAlertViewController is not working in iOS8 & above