useCss.js 679 B

123456789101112131415161718192021222324252627
  1. var util = require('util');
  2. var locateStrategy = require('./_locateStrategy.js');
  3. /**
  4. * Sets the locate strategy for selectors to `css selector`, therefore every following selector needs to be specified as css.
  5. *
  6. * ```
  7. * this.demoTest = function (browser) {
  8. * browser
  9. * .useCss() // we're back to CSS now
  10. * .setValue('input[type=text]', 'nightwatch');
  11. * };
  12. * ```
  13. *
  14. * @method useCss
  15. * @param {function} [callback] Optional callback function to be called when the command finishes.
  16. * @api commands
  17. */
  18. function Command() {
  19. this.strategy = 'css selector';
  20. locateStrategy.call(this);
  21. }
  22. util.inherits(Command, locateStrategy);
  23. module.exports = Command;