@testwizard/commands-video
Version:
33 lines (26 loc) • 1.1 kB
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = require('./FindPatternResult');
class FindPatternExCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'FindPatternEx');
}
async execute(filePath, mode, x, y, width, height) {
if (filePath === undefined)
throw new Error('filePath is required');
if (mode === undefined)
throw new Error('mode is required');
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 = [filePath, mode, x, y, width, height];
const json = await this.executeCommand(requestObj);
return new Result(json, 'findPatternEx was successful', 'findPatternEx failed');
}
}
module.exports = FindPatternExCommand;