Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

findElement.js 737B

1234567891011121314151617181920
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const constants_1 = require("../constants");
  4. const utils_1 = require("../utils");
  5. function findElement({ using, value }) {
  6. if (!constants_1.SUPPORTED_SELECTOR_STRATEGIES.includes(using)) {
  7. throw new Error(`selector strategy "${using}" is not yet supported`);
  8. }
  9. if (using === 'link text') {
  10. using = 'xpath';
  11. value = `//a[normalize-space() = "${value}"]`;
  12. }
  13. else if (using === 'partial link text') {
  14. using = 'xpath';
  15. value = `//a[contains(., "${value}")]`;
  16. }
  17. const page = this.getPageHandle(true);
  18. return utils_1.findElement.call(this, page, using, value);
  19. }
  20. exports.default = findElement;