@testwizard/commands-mobile
Version:
27 lines (20 loc) • 794 B
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = Commands.ResultForOkAndErrorMessage;
class ZoomCoordinatesCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'Mobile.ZoomCoordinates');
}
async execute(x, y, length) {
if (x === undefined)
throw new Error('x is required');
if (y === undefined)
throw new Error('y is required');
const requestObj = [x, y];
if (length !== undefined)
requestObj.push(length);
const json = await this.executeCommand(requestObj);
return new Result(json, 'zoomCoordinates was successful', 'zoomCoordinates failed');
}
}
module.exports = ZoomCoordinatesCommand;