module PageRight::CssHelper
Public Instance Methods
is_css_in_page?(css, flag=true)
click to toggle source
Check that a css element is on the page, set flag to check that it isn’t
# File lib/page_right/css_helper.rb, line 4 def is_css_in_page?(css, flag=true) if flag assert page.has_css?("#{css}"), "Error: #{css} not found on page !" else assert !page.has_css?("#{css}"), "Error: #{css} found on page !" end end
is_css_in_section?(css1, css2, flag=true)
click to toggle source
Check that a css element is nested within another css element, set flag to check that it isn’t
# File lib/page_right/css_helper.rb, line 13 def is_css_in_section?(css1, css2, flag=true) within("#{css1}") do if flag assert page.has_css?("#{css2}"), "Error: #{css2} not found in #{css1} !" else assert !page.has_css?("#{css2}"), "Error: #{css2} found in #{css1} !" end end end