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