Sha256: 7f8d93613b2047eaeed63c74469bb436fefe4cab6ae2e547f2cd37dc351e22f6

Contents?: true

Size: 482 Bytes

Versions: 3

Compression:

Stored size: 482 Bytes

Contents

var links = inDocument.getElementsByTagName('a');
var candidateLinks = $A(links).select(function(candidateLink) {
  var textMatched = PatternMatcher.matches(locator, getText(candidateLink));
  var idMatched = PatternMatcher.matches(locator, candidateLink.id);
  return textMatched || idMatched;
});
if (candidateLinks.length == 0) {
  return null;
}
candidateLinks = candidateLinks.sortBy(function(s) { return s.length * -1; }); //reverse length sort
return candidateLinks.first();

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jwilger-webrat-0.4.4.3 lib/webrat/selenium/location_strategy_javascript/webratlink.js
jwilger-webrat-0.4.4.4 lib/webrat/selenium/location_strategy_javascript/webratlink.js
jwilger-webrat-0.4.4.5 lib/webrat/selenium/location_strategy_javascript/webratlink.js