I was making some UI Tests using the new XCode 7. How my app uses Notification, on first use iOS automatically ask '"MyApp" Would Like to Send You Notifications'.
When I record the test, XCode write these lines below:
- (void)testFirstUse {
[XCUIDevice sharedDevice].orientation = UIDeviceOrientationPortrait;
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.alerts[@"\U201cMyApp\U201d Would Like to Send You Notifications"].collectionViews.buttons[@"OK"] tap];
[app.tables/*@START_MENU_TOKEN@*/.staticTexts[@"United States"]/*[[".cells.staticTexts[@\"United States\"]",".staticTexts[@\"United States\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/ tap];
[app.navigationBars[@"Select a Country"].buttons[@"Next"] tap];
}
Note that XCode puts the unicode instead of quotes signal on MyApp name. When a run the test fails with error "No matches found for alert".
I tried change the unicode to quote signal but it also doesn't work.
Is it clear? Had someone this same issue?
[Update] I have two issue on this code
1- There is a bug on message with unicodes generated by XCode
2- Test fails after tap on Alerts showed by system