Capybara cucumber/webrat:如何测试提交按钮是否未禁用
刚开始用黄瓜和网鼠。我有以下功能步骤:Capybara cucumber/webrat:如何测试提交按钮是否未禁用,capybara,webrat,Capybara,Webrat,刚开始用黄瓜和网鼠。我有以下功能步骤: When /^I choose a DVD$/ do #just click the first one we see check("optional-dvds[]") end Then /^I should be able to place my order$/ do #the place my order button should be clickable end 有问题的按钮包含以下html: <input disabled=
When /^I choose a DVD$/ do
#just click the first one we see
check("optional-dvds[]")
end
Then /^I should be able to place my order$/ do
#the place my order button should be clickable
end
有问题的按钮包含以下html:
<input disabled="disabled" id="submit_button" name="commit" type="submit" value="Please send this DVD">
或者类似的东西。我知道这是jquery和rspec的可怕混搭(顺便说一句:)试试这个
page.should have_no_xpath "//input[@id='submit_button' and @disabled]"
还是这个
page.should have_no_selector "#submit_button", :disabled => 'disabled'
page.should have_no_selector "#submit_button", :disabled => 'disabled'