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.

findElementFromElement.js 897B

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