Я застрял со следующей проблемой, это первый раз я использую водосвинку, есть ли у вас представление о том, как я могу решить эту проблему, благодаряКак решить Ошибка Капибара :: ElementNotFound
Я использую рельсы 3.0 .0 и следующих камни
gem 'rails', '3.0.0'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'cucumber'
gem 'rspec-rails'
gem 'spork'
gem 'launchy'
у меня есть следующий в моем Senario
When I go to the new customer page
And I fill in "Email" with "[email protected]"
в моем customer_steps.rb у меня есть
When /^I fill in "([^"]*)" with "([^"]*)"$/ do |arg1, arg2|
fill_in arg1, :with => arg2
end
На мой взгляд
- form_for @customer do |f|
= f.label :email, 'Email'
= f.text_field :email
= f.submit
Когда я бегу мой сценарий, я получаю сообщение об ошибке
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]"'
благодарит Rishav за ваш ответ, я уже пробовал и получил ту же ошибку, есть способ «сбрасывать» html страницы, чтобы узнать, ищет ли capybara в правильном коде? – denisjacquemin
эй, см. Журнал/test.log для любых ошибок .. –
хорошо, когда я запускаю огурец, я ничего не имею в своих файлах журналов (dev или test) – denisjacquemin