위치 기반 앱에 대해 UIAutomation 테스트를 작성하려고합니다. 여기 내 코드입니다 :iOS 6에서는 작동하지만 iOS 7에서는 작동하지 않는 UIAutomation (UIATarget.setLocationWithOptions)
var target = UIATarget.localTarget();
var mainWindow = target.frontMostApp().mainWindow();
// speed is in meters/sec
var points = [
{"location":{"latitude":46.783959176435,"longitude":23.542576152853}, "options":{"speed":32.33869934082}},
{"location":{"latitude":46.784235069873,"longitude":23.542993452429}, "options":{"speed":33.44660949707}},
{"location":{"latitude":46.784323173489,"longitude":23.543161503691}, "options":{"speed":33.76908493042}},
{"location":{"latitude":46.784514430638,"longitude":23.54344429169}, "options":{"speed":34.434867858887}},
{"location":{"latitude":46.784609053263,"longitude":23.543600872392}, "options":{"speed":34.673755645752}},
{"location":{"latitude":46.784701914083,"longitude":23.54376055256}, "options":{"speed":34.920608520508}},
{"location":{"latitude":46.784792299278,"longitude":23.543917345257}, "options":{"speed":34.939456939697}},
{"location":{"latitude":46.784869569202,"longitude":23.54409146343}, "options":{"speed":34.837844848633}},
{"location":{"latitude":46.784959115698,"longitude":23.544272081608}, "options":{"speed":34.80908203125}},
{"location":{"latitude":46.785085476228,"longitude":23.544603009802}, "options":{"speed":34.722270965576}},
{"location":{"latitude":46.785085476228,"longitude":23.544603009802}, "options":{"speed":0.0}}
];
var driveDetectionStarted;
for (var i = 0; i < points.length; i++){
target.setLocationWithOptions(points[i].location,points[i].options); // send location update
target.delay(0.2); // sleep until next location update
}
target.delay(1);
if (mainWindow.staticTexts()[0].value() == "Updates Received") {
driveDetectionStarted = true;
}
if (driveDetectionStarted) {
UIALogger.logPass("Location updates received as expected.");
} else {
UIALogger.logFail("Location updates logic failed.");
}
앱에서 위치 업데이트를받을 수 있으며, 모든 것이 괜찮 있다면, 그것은 "업데이트 수신"텍스트와 UILabel의 표시됩니다. 이 테스트는 iOS 6에서 작동하지만 iOS 7에서 위치 업데이트를받지 못합니다. target.delay (x) 메소드가 시뮬레이터에서 새 xcode로 작동하지 않기 때문에 디바이스에서 시도했습니다. (테스트를 거쳤으며 이전 xcode 버전에서 작동했습니다.)
iOS 7에서 테스트를 실행하는 사람이 있습니까? 누구도 같은 문제에 직면 해 있습니까? (좀 더 복잡한 테스트를 작성할 계획,하지만 난 위치 업데이트를 수신하지 않는 경우, 그때 간단한에 이동할 수 없습니다.)
내가 여기 같은 문제가 있습니다 당신에게
나는 애플에게 레이더를 신청했다. http://openradar.appspot.com/radar?id=4964878712307712 - 레이더 # 17838015 - 여전히 iOS 8 베타에서 작동하지 않습니다. – jmoody
8.0 SDK의 Beta (3,4,5)에서 실행 중이며 작동하지 않습니다. 실망. –