class Capybara::Selector

def css(*allowed_filters, &block)

Returns:
  • (#call) - The block that will be called to generate the CSS selector

Overloads:
  • css()
  • css(*expression_filters, &block)

Other tags:
    Yieldreturn: - An object that can produce a CSS selector

Other tags:
    Yieldparam: options - The options hash passed to the query
    Yieldparam: locator - The locator string passed to the query

Other tags:
    Yield: - The block to use to generate the CSS selector

Parameters:
  • expression_filters (Array) -- ([]) Names of filters that can be implemented via this CSS selector
def css(*allowed_filters, &block)
  if block
    @format, @expression = :css, block
    allowed_filters.flatten.each { |ef| expression_filters[ef] = nil }
  end
  format == :css ? @expression : nil
end