私はきゅうりとカピバラが初めてで、次のエラーに困惑しています:
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」ローカル変数を変更しているので、正規表現を変更する必要はないと思います。それとも私ですか?