Skip to content

Commit

Permalink
allow to move up to the parent or select current element
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Aug 25, 2015
1 parent 2cc4fba commit dc65b2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/helpers/find-element-strategy.js
Expand Up @@ -97,6 +97,10 @@ module.exports = function findStrategy() {
using = 'xpath';
value = xpathPrefix + (tag.length ? tag : '*') + '[contains(@' + classOrId + ', "' + classOrIdName + '") and contains(., "' + query.join('*=') + '")]';

// allow to move up to the parent or select current element
} else if (value === '..' || value === '.') {
using = 'xpath';

// if nothing fits with the supported strategies we fall back to the css selector strategy
} else {
using = 'css selector';
Expand Down

0 comments on commit dc65b2c

Please sign in to comment.