module PageRight::ImageHelper
Public Instance Methods
is_image_in_section?(section, image, count, flag=true)
click to toggle source
Check that ‘count’ number of ‘image’s is in a ‘section’ of css, set flag to check that it/they isn’t/arn’t
# File lib/page_right/image_helper.rb, line 4 def is_image_in_section?(section, image, count, flag=true) if flag assert page.has_selector?(:css,"#{section} img[src$='/assets/#{image}']", count: count), "Error: #{count} #{image}(s) not found in #{section} !" else assert !page.has_selector?(:css,"#{section} img[src$='/assets/#{image}']", count: count), "Error: #{count} #{image}(s) found in #{section} !" end end