1
나는 오이 1.1.1와 레일 3 응용 프로그램에서 일하고있어 내 오이 시나리오에서 여러 확인란을 선택하려고합니다.오이 여러 확인란을 선택
@wip
Scenario: New Clergy
Given I am on the clergies page
When I follow "New Clergy"
And I fill in "Surname" with "Wells"
And I fill in "Given names" with "Robin"
And I check the 1st of the "diocese" checkboxes
And I check the 2nd of the "diocese" checkboxes
And I press "Create Clergy"
Then I should see "Clergy was successfully created."
내가 오류 실행 : 여기
- for diocese in Diocese.all
= check_box_tag "clergy[diocese_ids][]", diocese.id, @clergy.dioceses.include?(diocese)
= f.label diocese.name
%br
내 오이 테스트입니다 내 오이 단계
여기
When /^I check the (\d+)(st|nd|rd|th) of the "([^"]*)" checkboxes$/ do |index, junk, group|
page.all("input[id=\"clergy_diocese_ids_\"]")[index.to_i - 1].check('clergy_diocese_ids_')
end
입니다 : 여기
는 HAML 내 여러 체크 박스입니다 내 검사 :And I check the 1st of the "diocese" checkboxes # fea
tures/step_definitions/clergy_steps.rb:37
cannot check field, no checkbox with id, name, or label 'clergy_diocese_ids_' found (C
apybara::ElementNotFound)
./features/step_definitions/clergy_steps.rb:38:in `/^I check the (\d+)(st|nd|rd|th) of
the "([^"]*)" checkboxes$/'
features/clergy_new.feature:17:in `And I check the 1st of the "diocese" checkboxes'
나는 page.all 선택기로 놀아 보려고했지만 시도 할 수 없습니다.
렌더링 된 페이지 출력을 확인하여 확인란의 id 속성 형식을 확인 했습니까? –
예 파이어 폭스에서 firebug를 사용하여 내 체크 박스 ID를 확인했습니다. – map7
귀하의 오이 단계에서 귀하의 테스트가 모든 체크 박스가 동일한 ID를 공유 할 것으로 예상되는 것처럼 보입니다. 문자열 보간법을 사용하여 선택해야하는 체크 박스의 올바른 ID를 형성해야합니까? –