UIATarget.localTarget(). model()에는 검사가 실행되는 장치에 대한 정보가 들어 있습니다.
나는 Alex Vollmer's tuneup_js library을 발견했습니다. 그것은 최소한 어느 정도 장치 독립 코드를 허용합니다.
예)
test("my test", function(target, app) {
assertWindow({
"navigationBar~iphone": {
leftButton: { name: "Back" },
rightButton: { name: "Done" }
},
"navigationBar~ipad": {
leftButton: null,
rightButton: { name: "Cancel" }
},
});
});
편집 tuneup_js에서 다음을 찾을 수
: 나는 장치 특정 코드를 작성 할 수 있습니다 다음으로
/**
* A convenience method for detecting that you're running on an iPad
*/
isDeviceiPad: function() {
return this.model().match(/^iPad/) !== null;
},
/**
* A convenience method for detecting that you're running on an
* iPhone or iPod touch
*/
isDeviceiPhone: function() {
return this.model().match(/^iPhone/) !== null;
}
.
파일 내 유틸리티에서 StrContains 방법에 대한 코드 당신의 코드를 작성하십시오. 그렇다면 어떻게 호출해야합니까? –
인터페이스가 아마도 내가 찾고있는 인터페이스 일 것입니다. Xcode의 자동화 도구를 사용하여 Apple에서 지시 한대로 스크립트 파일을로드합니다. 내가 아는 한, 이것은 앱을 테스트하기 위해 공식적으로 지원되는 방법입니다. http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html#//apple_ref/doc/uid/TP40009903 – MdaG