Sha256: 0461f86163f580125d1f3ffdbccff412579def1fa5f68e3ee93a83041c52b24f

Contents?: true

Size: 493 Bytes

Versions: 64

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true

Capybara.add_selector(:link_or_button, locator_type: [String, Symbol]) do
  label 'link or button'
  xpath do |locator, **options|
    %i[link button].map do |selector|
      expression_for(selector, locator, **options)
    end.reduce(:union)
  end

  node_filter(:disabled, :boolean, default: false, skip_if: :all) { |node, value| !(value ^ node.disabled?) }

  describe_node_filters do |disabled: nil, **|
    ' that is disabled' if disabled == true
  end
end

Version data entries

64 entries across 51 versions & 5 rubygems

Version Path
capybara-3.20.1 lib/capybara/selector/definition/link_or_button.rb
capybara-3.20.0 lib/capybara/selector/definition/link_or_button.rb
capybara-3.19.1 lib/capybara/selector/definition/link_or_button.rb
capybara-3.19.0 lib/capybara/selector/definition/link_or_button.rb