UNPKG

webdriverio

Version:

Next-gen browser and mobile automation test framework for Node.js

26 lines (20 loc) 505 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getLocation; var _utils = require("../../utils"); async function getLocation(prop) { let location = {}; if (this.isW3C) { location = await (0, _utils.getElementRect)(this); delete location.width; delete location.height; } else { location = await this.getElementLocation(this.elementId); } if (prop === 'x' || prop === 'y') { return location[prop]; } return location; }