我的页面似乎正常工作,但是我的黄瓜测试显示错误。
HAML中页面的相关位:
= simple_form_for(@client, url: { action: "update_password" }, html: { method: :put }) do |f|
STUFF
= f.submit "Update password", id: "submit", :class => "btn btn-primary submit"
崩溃的行是“我提交表单”,即:
When /^I submit the form$/ do
generic_form_page = GenericFormPage.new(Capybara.current_session)
generic_form_page.submit
if Capybara.current_session.mode == :poltergeist
ajax_page = GenericAjaxPage.new Capybara.current_session
ajax_page.wait_for_ajax_call_to_finish
end
end
我得到的错误是:
And I submit the form # features/step_definitions/shared/common_steps.rb:30
Unable to find css ".simple_form input[type=submit]" (Capybara::ElementNotFound)
./features/pages/support/form_page_mixin.rb:3:in `submit'
./features/step_definitions/shared/common_steps.rb:32:in `/^I submit the form$/'
features/admin/change_client_password.feature:22:in `And I submit the form'