@testwizard/commands-mobile
Version:
23 lines (16 loc) • 650 B
JavaScript
;
const CommandBase = require('@testwizard/commands-core').CommandBase;
const Result = require('./GetSizeResult');
class GetElementSizeCommand extends CommandBase {
constructor(testObject) {
super(testObject, 'Mobile.GetElementSize');
}
async execute(selector) {
if (selector === undefined)
throw new Error('selector is required');
const requestObj = [selector];
const json = await this.executeCommand(requestObj);
return new Result(json, 'getElementSize was successful', 'getElementSize failed');
}
}
module.exports = GetElementSizeCommand;