3
상자를 확인/선택 취소하는 것과 관련된 시나리오의 단계 정의를 작성하고 있습니다. 단계 정의에서 web_steps.rb의 기존 단계를 사용하려고합니다. 그러나 나는 오류가 나타납니다 : 정의되지 않은 단계 : "나는 '등급'체크". myfeature_steps.rb가 web_steps.rb를 인식하도록하기 위해해야 할 일이 있습니까? 감사!내 단계 정의에 web_steps.rb의 오이 재사용 단계 myfeature_steps.rb
When /I (un)?check the following ratings: (.*)/ do |uncheck, rating_list|
ratings = rating_list.split(%r{,\s*})
if uncheck
ratings.each do |r|
step "I uncheck #{r}"
end
else
ratings.each do |r|
step "I check #{r}"
end
end
end
다음 단계 정의는
When /^(?:|I)check "([^"]*)"$/ do |field|
check(field)
end
When /^(?:|I)uncheck "([^"]*)"$/ do |field|
uncheck(field)
end
감사합니다. 이 작동합니다. 나는 그대로 내 단계 정의를 떠났지만 지금은 내 단계에서 큰 따옴표로 묶인 요소를 제공하고 있습니다. – user1493570