UNPKG

@testwizard/commands-video

Version:

26 lines (19 loc) 720 B
'use strict'; const Commands = require('@testwizard/commands-core'); const Result = require('./SnapShotResult'); class SnapShotJPGCommand extends Commands.CommandBase { constructor(testObject) { super(testObject, 'SnapShotJPG'); } async execute(fileName, quality) { if (fileName === undefined) throw new Error('fileName is required'); const requestObj = [fileName]; if (quality !== undefined) { requestObj.push(quality); } const json = await this.executeCommand(requestObj); return new Result(json, 'snapShotJPG was successful', 'snapShotJPG failed'); } } module.exports = SnapShotJPGCommand;