UNPKG

@testwizard/commands-mobile

Version:

28 lines (22 loc) 766 B
'use strict'; const Commands = require('@testwizard/commands-core'); const Result = Commands.ResultForOkAndErrorMessage; class LaunchAppCommand extends Commands.CommandBase { constructor(testObject) { super(testObject, 'Mobile.LaunchApp'); } async execute(appId, activityId) { const requestObj = []; if(appId !== undefined) { requestObj.push(appId); } else { requestObj.push(null); } if(activityId !== undefined) { requestObj.push(activityId); } const json = await this.executeCommand(requestObj); return new Result(json, 'launchApp was successful', 'launchApp failed'); } } module.exports = LaunchAppCommand;