UNPKG

@testwizard/commands-video

Version:

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