def wait_for_views(*queries,
                       timeout: Calabash::Wait.default_options[:timeout],
                       timeout_message: nil,
                       retry_frequency: Calabash::Wait.default_options[:retry_frequency])
      if queries.nil? || queries.any?(&:nil?)
        raise ArgumentError, 'Query cannot be nil'
      end

      timeout_message ||= lambda do |wait_options|
          "Waited #{wait_options[:timeout]} seconds for #{Wait.parse_query_list(queries)} to each match a view"
      end

      wait_for(timeout_message,
               timeout: timeout,
               retry_frequency: retry_frequency,
               exception_class: ViewNotFoundError) do
        views_exist?(*queries)
      end

      # Do not return the value of views_exist?(queries) as it clutters
      # a console environment
      true
    end
def wait_for_views(*queries,
                       timeout: Calabash::Wait.default_options[:timeout],
                       timeout_message: nil,
                       retry_frequency: Calabash::Wait.default_options[:retry_frequency])
      if queries.nil? || queries.any?(&:nil?)
        raise ArgumentError, 'Query cannot be nil'
      end

      timeout_message ||= lambda do |wait_options|
          "Waited #{wait_options[:timeout]} seconds for #{Wait.parse_query_list(queries)} to each match a view"
      end

      wait_for(timeout_message,
               timeout: timeout,
               retry_frequency: retry_frequency,
               exception_class: ViewNotFoundError) do
        views_exist?(*queries)
      end

      # Do not return the value of views_exist?(queries) as it clutters
      # a console environment
      true
    end
Waits for all `queries` to simultaneously match at least one view.

 @example
  cal.wait_for_views({id: 'foo'}, {id: 'bar'})

 @see Calabash::Wait#wait_for for optional parameters

 @param [String, Hash, Calabash::Query] queries List of queries or a
  query.
 @return The returned value is undefined
 @raise [ViewNotFoundError] If `queries` do not all match at least one
  view.