@testwizard/commands-mobile
Version:
29 lines (21 loc) • 870 B
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = Commands.ResultForOkAndErrorMessage;
class StartDeviceLoggingCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'Mobile.StartDeviceLogging');
}
async execute(fileName, userName, password) {
if (fileName === undefined)
throw new Error('fileName is required');
const requestObj = [fileName];
if (userName !== undefined) {
requestObj.push(userName);
if (password !== undefined)
requestObj.push(password);
}
const json = await this.executeCommand(requestObj);
return new Result(json, 'startDeviceLogging was successful', 'startDeviceLogging failed');
}
}
module.exports = StartDeviceLoggingCommand;