@testwizard/commands-mobile
Version:
25 lines (18 loc) • 723 B
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = Commands.ResultForOkAndErrorMessage;
class InputTextCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'Mobile.InputText');
}
async execute(selector, text) {
if (selector === undefined)
throw new Error('selector is required');
if (text === undefined)
throw new Error('text is required');
const requestObj = [selector, text];
const json = await this.executeCommand(requestObj);
return new Result(json, 'inputText was successful', 'inputText failed');
}
}
module.exports = InputTextCommand;