UNPKG

@testwizard/commands-video

Version:

37 lines (30 loc) 1.38 kB
'use strict'; const Commands = require('@testwizard/commands-core'); const Result = require('./WaitForPatternResult'); class WaitForPatternNoMatchCommand extends Commands.CommandBase { constructor(testObject) { super(testObject, 'WaitForPatternNoMatch'); } async execute(fileName, minSimilarity, timeout, mode, x, y, width, height) { if (fileName === undefined) throw new Error('fileName is required'); if (minSimilarity === undefined) throw new Error('minSimilarity is required'); if (timeout === undefined) throw new Error('timeout 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 = [fileName, minSimilarity, timeout, mode, x, y, width, height]; const json = await this.executeCommand(requestObj); return new Result(json, 'waitForPatternNoMatch was successful', 'waitForPatternNoMatch failed'); } } module.exports = WaitForPatternNoMatchCommand;