useRecursion.js 605 B

1234567891011121314151617181920
  1. var util = require('util');
  2. var locateStrategy = require('./_locateStrategy.js');
  3. /**
  4. * Sets the locate strategy for selectors to `recursion`, therefore every following selector needs to be an array of element objects
  5. * This is used internally for sections of page objects which require element nesting
  6. *
  7. * @method useRecursion
  8. * @param {function} [callback] Optional callback function to be called when the command finishes.
  9. * @api commands
  10. */
  11. function Command() {
  12. this.strategy = 'recursion';
  13. locateStrategy.call(this);
  14. }
  15. util.inherits(Command, locateStrategy);
  16. module.exports = Command;