Created
September 1, 2015 18:23
-
-
Save titusfortner/92c2eba8cd6a496c62cf to your computer and use it in GitHub Desktop.
Monkey Patches
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
def find_element_by(how, what, parent = nil) | |
if protractor.finder? how | |
return protractor_find(false, how, what, parent) | |
end | |
if parent | |
id = execute :findChildElement, { :id => parent }, { :using => how, :value => what } | |
else | |
id = execute :findElement, {}, { :using => how, :value => what } | |
end | |
Element.new self, element_id_from(id) | |
end |
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
def find_element_by(how, what, parent = nil) | |
if parent | |
id = execute :findChildElement, {:id => parent}, {:using => how, :value => what} | |
else | |
id = execute :findElement, {}, {:using => how, :value => what} | |
end | |
Element.new self, element_id_from(id) | |
end |
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
alias_method :se_find_element_by, :find_element_by | |
def find_element_by(how, what, parent = nil) | |
if protractor.finder? how | |
protractor_find(false, how, what, parent) | |
else | |
se_find_element_by(how, what, parent) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment