2012-11-30 2 views
1

와 TextField를 만지지 수 있으며, 자리없이 하나 UITextLable 하나의 UITextField 이의 UITextField로 만들어 있었고, 난 내 기능 파일 터치 태그에 의해이 UITextFeild를 작성해야 을 accessibilityhint.프랭크 내가있는 UITableViewCell이 태그

 
When /^I touch the (\d*)(?:st|nd|rd|th)? text field$/ do |ordinal| 
    ordinal = ordinal.to_i 
    text_field_selector = "textField tag:#{ordinal}" 
    frankly_map (text_field_selector, 'becomeFirstResponder') 
end 

이제 프랭크는 마지막으로 어떤을 제기하지 :이 단계의 정의와

 
When /^I touch the (\d*)(?:st|nd|rd|th)? text field$/ do |ordinal| 
    ordinal = ordinal.to_i 
    text_field_selector = "textField tag:#{ordinal}" 
    touch (text_field_selector) 
end 

는 프랭크 (오이) 오류 메시지가
could not find anything matching [textFeild tag:2]

그리고 난에 내 코드를 변경했습니다 말했다 제기 오류 메시지가 표시되고 통과 된 테스트 단계로 표시됩니다. 하지만이 테스트 단계로 넘어 가면 키보드가 나타나서 사용자가 텍스트를 입력 할 때까지 기다릴 것으로 예상했습니다. 실제 결과는 키보드가 조금 깜박이고 빠르게 사라졌습니다. 아무것도 입력 할 수 없습니다.

이것은 이상한 것이고 나는 이것에 대해 무엇인지 잘 모르겠습니다.

답변

0

나는 솔직하지는 않지만 ask 방법을 사용하여 오이의 콘솔에서 매개 변수를 잡을 수 있습니다. 다음과 같이 표시됩니다.

When /^I touch the text field$/ do 
    ordinal = ask("Which field number?").to_i 
    text_field_selector = "textField tag:#{ordinal}" 
    touch (text_field_selector) 
end 
관련 문제