Je suis coincé avec le problème suivant, c'est la première fois que je l'utilise capybara, vous avez une idée comment je peux résoudre ce problème, merciComment résoudre un Capybara :: ElementNotFound Erreur
J'utilise Rails 3.0 .0 et les gemmes suivantes
gem 'rails', '3.0.0'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'cucumber'
gem 'rspec-rails'
gem 'spork'
gem 'launchy'
je suit dans mon senario
When I go to the new customer page
And I fill in "Email" with "[email protected]"
dans mon customer_steps.rb Je
When /^I fill in "([^"]*)" with "([^"]*)"$/ do |arg1, arg2|
fill_in arg1, :with => arg2
end
À mon avis
- form_for @customer do |f|
= f.label :email, 'Email'
= f.text_field :email
= f.submit
Quand je lance mon scénario, je reçois ce message d'erreur
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]"'
grâce Rishav pour votre réponse, je l'ai déjà essayé et a obtenu la même erreur, est-il façon de «vider» le code HTML de la page pour voir si capybara recherche dans le bon code? – denisjacquemin
hey, voir log/test.log pour toute erreur .. –
bien, quand je cours de concombre je n'ai rien dans mes fichiers journaux (dev ou test) – denisjacquemin