UNPKG

@testwizard/commands-mobile

Version:

23 lines (16 loc) 674 B
'use strict'; const Commands = require('@testwizard/commands-core'); const Result = Commands.ResultForOkAndErrorMessage; class Android_SendkeyCodeCommand extends Commands.CommandBase { constructor(testObject) { super(testObject, 'Mobile.Android_SendKeyCode'); } async execute(keyCode) { if (keyCode === undefined) throw new Error('keyCode is required'); const requestObj = [keyCode]; const json = await this.executeCommand(requestObj); return new Result(json, 'android_SendkeyCode was successful', 'android_SendkeyCode failed'); } } module.exports = Android_SendkeyCodeCommand;