Wie man einen Capybara :: ElementNotFound-Fehler löst
Ich habe folgendes Problem, dies ist das erste Mal, dass ich Capybara verwende. Habt Ihr eine Idee, wie ich dieses Problem lösen kann? Danke.
Ich benutze Schienen 3.0.0 und die folgenden Edelsteine
gem 'rails', '3.0.0'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'cucumber'
gem 'rspec-rails'
gem 'spork'
gem 'launchy'
Ich habe die folgenden in meinem Senario
When I go to the new customer page
And I fill in "Email" with "[email protected]"
in my customer_steps.rb Ich habe
When /^I fill in "([^"]*)" with "([^"]*)"$/ do |arg1, arg2|
fill_in arg1, :with => arg2
end
Meiner Ansicht nac
- form_for @customer do |f|
= f.label :email, 'Email'
= f.text_field :email
= f.submit
Wenn ich mein Szenario starte, erhalte ich diese Fehlermeldung
Scenario: Register new customer # features/manage_customers.feature:7
When I go to the new customer page # features/step_definitions/customer_steps.rb:1
And I fill in "Email" with "[email protected]" # features/step_definitions/customer_steps.rb:5
cannot fill in, no text field, text area or password field with id, name, or label 'Email' found (Capybara::ElementNotFound)
./features/step_definitions/customer_steps.rb:6:in `/^I fill in "([^"]*)" with "([^"]*)"$/'
features/manage_customers.feature:9:in `And I fill in "Email" with "[email protected]"'