UNPKG

@testwizard/commands-mobile

Version:

25 lines (18 loc) 731 B
'use strict'; const Commands = require('@testwizard/commands-core'); const Result = Commands.ResultForOkAndErrorMessage; class AddCapabilityCommand extends Commands.CommandBase { constructor(testObject) { super(testObject, 'Mobile.AddCapability'); } async execute(name, value) { if (name === undefined) throw new Error('name is required'); if (value === undefined) throw new Error('value is required'); const requestObj = [name, value]; const json = await this.executeCommand(requestObj); return new Result(json, 'addCapability was successful', 'addCapability failed'); } } module.exports = AddCapabilityCommand;