@testwizard/commands-video
Version:
29 lines (22 loc) • 875 B
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = Commands.ResultForOkAndErrorCode;
class SetRegionCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'SetRegion');
}
async execute(x, y, width, height) {
if (x === undefined)
throw new Error('x is required');
if (y === undefined)
throw new Error('y is required');
if (width === undefined)
throw new Error('width is required');
if (height === undefined)
throw new Error('height is required');
const requestObj = [x, y, width, height];
const json = await this.executeCommand(requestObj);
return new Result(json, 'setRegion was successful', 'setRegion failed');
}
}
module.exports = SetRegionCommand;