-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be5ffef
commit 1e1f7f8
Showing
31 changed files
with
991 additions
and
2,289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module Watir | ||
module Locators | ||
class Button | ||
class Matcher < Element::Matcher | ||
def elements_match?(element, values_to_match) | ||
copy_values_to_match = values_to_match.dup | ||
value = copy_values_to_match.delete(:value) | ||
|
||
if value | ||
matching = matches_values?(fetch_value(element, :text), value) | ||
deprecate_value_button if matching | ||
|
||
matching ||= matches_values?(fetch_value(element, :value), value) | ||
|
||
return false unless matching | ||
return true if copy_values_to_match.empty? | ||
end | ||
|
||
super(element, copy_values_to_match) | ||
end | ||
|
||
def deprecate_value_button | ||
Watir.logger.deprecate(':value locator key for finding button text', | ||
'use :text locator', | ||
ids: [:value_button]) | ||
end | ||
|
||
def validate_tag(element, _tag_name) | ||
tag_name = element.tag_name.downcase | ||
return unless %w[input button].include?(tag_name) | ||
|
||
# TODO: - Verify this is desired behavior based on https://bugzilla.mozilla.org/show_bug.cgi?id=1290963 | ||
return if tag_name == 'input' && !Watir::Button::VALID_TYPES.include?(element.attribute('type').downcase) | ||
|
||
element | ||
end | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.