Я унаследовал приложение Rails, но незнаком с этой конкретной тестовой средой.Когда тесты на огурец выполняются, мы получаем:
Scenario: Add only an image to a profile by url # features/add_an_image_by_file_url.feature:11
Given I am logged in as a user "admin" # features/step_definitions/user_steps.rb:19
And I create a profile for "Joe Blogs" # features/step_definitions/profile_steps.rb:1
And I have a fake image url "http://fake.com/images/profile.jpg" # features/step_definitions/photo_steps.rb:1
When I follow "New photo" # features/step_definitions/web_steps.rb:32
And I fill in "Url" with "http://fake.com/images/profile.jpg" # features/step_definitions/web_steps.rb:38
And I press "Create" # features/step_definitions/web_steps.rb:26
Then I should see "Photo was successfully uploaded." # features/step_definitions/web_steps.rb:99
And I should see "profile.jpg" within first profile item # features/step_definitions/item_steps.rb:18
Unable to find css "ul#items li:first" (Capybara::ElementNotFound)
(eval):2:in `find'
./features/step_definitions/web_steps.rb:13:in `with_scope'
./features/step_definitions/web_steps.rb:100:in `/^I should see "([^\"]*)"(?: within "([^\"]*)")?$/'
features/add_an_image_by_file_url.feature:19:in `And I should see "profile.jpg" within first profile item'
Это происходит из item_steps:
Then /^I should see "([^\"]*)" within (.*?) profile item$/ do |string, filter|
Then %Q{I should see "#{string}" within "ul#items li:#{filter}"}
end
И соответствующих веб-шагов:
Then /^I should see "([^\"]*)"(?: within "([^\"]*)")?$/ do |text, selector|
with_scope(selector) do
if defined?(Spec::Rails::Matchers)
page.should have_content(text)
else
assert page.has_content?(text)
end
end
end
HTML-код, о котором идет речьвыглядеть так:
<ul id='items'>
<li class='note clearfix'>
<div class='content'>
<img src="profile.jpg"/>
</div>
</li>
</ul>
Что здесь происходит на Земле?