Sha256: 71a8ac8e6d07a34880dc2e24b9e61ab4350b80ce48dbe89d5601eb7e29b4672d
Contents?: true
Size: 555 Bytes
Versions: 17
Compression:
Stored size: 555 Bytes
Contents
module Locator::Equal EQUAL_REGEX = /\A([^\p{L}]*)(=)(.*)\Z/ module_function def execute(locator) matches = EQUAL_REGEX.match(locator) if matches captures = matches.captures locator = "#{captures[0]}#{captures[2]}" xpath = ".//*[text()='#{locator}']" [locator, xpath] else # # find node that contains *text* and does not have any child nodes that contain *text* # xpath = ".//*[contains(., '#{locator}')][not(*[contains(., '#{locator}')])]" [locator, xpath] end end end
Version data entries
17 entries across 17 versions & 1 rubygems