Sha256: 89790ae887c75ff9432be4a62d9364837498ab055171cbe4986c0a5da10e7440

Contents?: true

Size: 720 Bytes

Versions: 19

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

require 'capybara/selector/filters/base'

module Capybara
  class Selector
    module Filters
      class LocatorFilter < NodeFilter
        def initialize(block, **options)
          super(nil, nil, block, options)
        end

        def matches?(node, value, context = nil, exact:)
          apply(node, value, true, context, exact: exact, format: context&.default_format)
        rescue Capybara::ElementNotFound
          false
        end

      private

        def apply(subject, value, skip_value, ctx, **options)
          return skip_value if skip?(value)

          filter_context(ctx).instance_exec(subject, value, **options, &@block)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/capybara-3.29.0/lib/capybara/selector/filters/locator_filter.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.29.0/lib/capybara/selector/filters/locator_filter.rb
tdiary-5.1.0 vendor/bundle/gems/capybara-3.29.0/lib/capybara/selector/filters/locator_filter.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/selector/filters/locator_filter.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/selector/filters/locator_filter.rb
capybara-3.29.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.28.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.27.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.26.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.25.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.24.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.23.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.22.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.21.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.20.2 lib/capybara/selector/filters/locator_filter.rb
capybara-3.20.1 lib/capybara/selector/filters/locator_filter.rb
capybara-3.20.0 lib/capybara/selector/filters/locator_filter.rb
capybara-3.19.1 lib/capybara/selector/filters/locator_filter.rb
capybara-3.19.0 lib/capybara/selector/filters/locator_filter.rb