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