UNPKG

webdriverio

Version:

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

27 lines (21 loc) 455 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getSize; var _utils = require("../../utils"); async function getSize(prop = null) { let rect = {}; if (this.isW3C) { rect = await (0, _utils.getElementRect)(this); } else { rect = await this.getElementSize(this.elementId); } if (rect[prop]) { return rect[prop]; } return { width: rect.width, height: rect.height }; }