2012-11-06 2 views
3

KIF 테스트에서 UIWebView 구성 요소를 타겟팅 할 수 있습니까?KIF에서 UIWebView 구성 요소를 타겟팅 할 수 있습니까?

stepToTapScreenAtPoint을 사용하여 제한된 기능을 관리했지만 대상 콘텐츠가 "스크롤해야 볼 수있는 부분"인 경우 주요 문제가 있습니다.

나는 stepToEnterText:kTestEmail intoViewWithAccessibilityLabel:@"Email"]을 사용하여 성공을 거두었지만 입력 필드 & 입력을 시작할 수는 있지만 입력을 마친 후에는 테스트가 실패합니다.

제 질문은 웹 뷰 기반 단계를 타겟팅하는 KIF 지원입니까? 이것을 테스트하는 올바른 방법은 무엇입니까?

감사합니다. (KIF의 아래 결과)

Integration[29024:c07] PASS (0.01s): Tap screen at point "{50, 520}" 
2012-11-06 14:49:58.493 Integration[29024:c07] FAIL (4.48s): Type the text "[redacted]" into the view with accessibility label "Email" 
2012-11-06 14:49:58.494 Integration[29024:c07] FAILING ERROR: Error Domain=KIFTest Code=0 "Failed to actually enter text "[redacted]" in field; instead, it was "SIGN UP 
Sign in 

Email 

Password 

    Stay signed in 
Can't access your account? 
Coming soon: A new sign-in page! Try it now Learn more 
© 2012 Google Privacy Policy Help"" UserInfo=0x14eda060 {NSLocalizedDescription=Failed to actually enter text "[redacted]" in field; instead, it was "SIGN UP 
Sign in 

Email 

Password 

    Stay signed in 
Can't access your account? 
Coming soon: A new sign-in page! Try it now Learn more 
© 2012 Google Privacy Policy Help"} 
2012-11-06 14:49:58.494 Integration[29024:c07] --------------------------------------------------- 
2012-11-06 14:49:58.494 Integration[29024:c07] END OF SCENARIO (duration 11.15s) 
2012-11-06 14:49:58.495 Integration[29024:c07] 

답변

2

년 후 여전히 아무도 게시물 솔루션은 그럼 난 그냥 첫 번째 응답자를 사용하는 대신에 입력하여 주변에 작품을 만들어 유사한 문제를 가지고 있음을 공유 할 텍스트 필드

내 프로젝트의 코드에서 가져온 스 니펫입니다. 너와 잘 작동 시켜라. 희망이 사람을 도와줍니다!

//Make sure the field is in view 
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Username"]]; 

//This will pop the keyboard to screen 
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabe:@"Username"]]; 

[scenario addStep:[KIFTestStep stepToEnterTextIntoCurrentFirstResponder:@"testUser"]]; 
관련 문제