lib/watir/locators/button/selector_builder.rb in watir-6.5.0 vs lib/watir/locators/button/selector_builder.rb in watir-6.6.0
- old
+ new
@@ -6,18 +6,21 @@
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}]"
-
+
+ unless selectors[:type] == false
+ selectors[:type] = Watir::Button::VALID_TYPES if [nil, true].include?(selectors[:type])
+ input_attr_exp = xpath_builder.attribute_expression(:input, selectors)
+
+ xpath << " | .//input"
+ xpath << "[#{input_attr_exp}]"
+ end
+
p build_wd_selector: xpath if $DEBUG
[:xpath, xpath]
end
end