所以我有該規範水豚:FILL_IN動作定位器
describe "visit /signup" do
before(:each) do
get signup_path
end
it "has an email input field" do
page.has_field?("#user_email")
end
it "accepts an email address" do
page.fill_in('#user_email', :with=>Faker::Internet.email)
end
end
第一個測試(已經電子郵件輸入)通過,所述第二失敗
Failure/Error: page.fill_in('#user_email', :with=>Faker::Internet.email)
Capybara::ElementNotFound:
cannot fill in, no text field, text area or password field with id, name, or label '#user_email' found
輸入[類型=「文本」 ]元素存在於具有該DOM ID的頁面上,嘗試使用帶和不帶散列的ID進行定位,並將其輸入:name用作定位符。
我在做什麼錯?
'save_and_open_page'在調試時也非常有用 – oliyoung