Sha256: e4865840757fa5f9f813c0b8f037681ff1d2b2e3f18890577cc4179a5a4c4ba7

Contents?: true

Size: 807 Bytes

Versions: 23

Compression:

Stored size: 807 Bytes

Contents

module Watir
  module Locators
    class Button
      class SelectorBuilder < Element::SelectorBuilder
        def build_wd_selector(selectors)
          return if selectors.values.any? { |e| e.kind_of? Regexp }

          selectors.delete(:tag_name) || raise("internal error: no tag_name?!")

          button_attr_exp = xpath_builder.attribute_expression(:button, selectors)

          selectors[:type] = Watir::Button::VALID_TYPES
          input_attr_exp = xpath_builder.attribute_expression(:input, selectors)

          xpath = ".//button"
          xpath << "[#{button_attr_exp}]" unless button_attr_exp.empty?
          xpath << " | .//input"
          xpath << "[#{input_attr_exp}]"

          p build_wd_selector: xpath if $DEBUG

          [:xpath, xpath]
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
watir-6.5.0 lib/watir/locators/button/selector_builder.rb
watir-6.4.3 lib/watir/locators/button/selector_builder.rb
watir-6.4.2 lib/watir/locators/button/selector_builder.rb
watir-6.4.1 lib/watir/locators/button/selector_builder.rb
watir-6.4.0 lib/watir/locators/button/selector_builder.rb
watir-6.4.0.rc2 lib/watir/locators/button/selector_builder.rb
watir-6.4.0.rc1 lib/watir/locators/button/selector_builder.rb
watir-6.3.0 lib/watir/locators/button/selector_builder.rb
watir-6.2.1 lib/watir/locators/button/selector_builder.rb
watir-6.2.0 lib/watir/locators/button/selector_builder.rb
watir-6.1.0 lib/watir/locators/button/selector_builder.rb
watir-6.0.3 lib/watir/locators/button/selector_builder.rb
watir-6.0.2 lib/watir/locators/button/selector_builder.rb
watir-6.0.1 lib/watir/locators/button/selector_builder.rb
watir-webdriver-0.9.9 lib/watir-webdriver/locators/button/selector_builder.rb
watir-6.0.0 lib/watir/locators/button/selector_builder.rb
watir-6.0.0.beta5 lib/watir/locators/button/selector_builder.rb
watir-6.0.0.beta4 lib/watir/locators/button/selector_builder.rb
watir-6.0.0.beta3 lib/watir/locators/button/selector_builder.rb
watir-6.0.0.beta2 lib/watir/locators/button/selector_builder.rb