0
나는 오이 카피 바라 새로운 오전과 나는 다음과 같은 오류가 의아해입니다 : 내가 가진카피 바라 & 오이 CSS 로케이터를 찾을 수 없습니다
When I click the "Search" button # features/step_definitions/web_steps.rb:9
Unable to find button #<Capybara::Element tag="button"> (Capybara::ElementNotFound)
./features/step_definitions/web_steps.rb:11:in `/^I click the "([^"]*)" button$/'
features/search.feature:9:in `When I click the "Search" button'
내 기능 내 :
는When I click the "Search" button
내 단계는 같다 :
When /^I click the "([^"]*)" button$/ do |button_text|
button_text = find('#gbqfb')
click_button button_text
end
나는 'click (button_text) 및 click_link 메소드를 시도했다. 나는 내가 볼 수 없다는 것을 분명히 알았습니다. 버튼 요소에 대한 CSS 로케이터를 찾은 다음 해당 요소를 클릭하려고합니다. 나는 'button_text'지역 변수가 어쨌든 변경 되었기 때문에 정규 표현식을 변경할 필요가 없다고 생각합니다. 아니면 내가?