UNPKG

@testwizard/commands-mobile

Version:

33 lines (26 loc) 1.11 kB
'use strict'; const Commands = require('@testwizard/commands-core'); const Result = Commands.ResultForOkAndErrorMessage; class SwipeArcCommand extends Commands.CommandBase { constructor(testObject) { super(testObject, 'Mobile.SwipeArc'); } async execute(x, y, radius, degreeStart, degrees, steps) { if (x === undefined) throw new Error('x is required'); if (y === undefined) throw new Error('y is required'); if (radius === undefined) throw new Error('radius is required'); if (degreeStart === undefined) throw new Error('degreeStart is required'); if (degrees === undefined) throw new Error('degrees is required'); if (steps === undefined) throw new Error('steps is required'); const requestObj = [x, y, radius, degreeStart, degrees, steps]; const json = await this.executeCommand(requestObj); return new Result(json, 'swipeArc was successful', 'swipeArc failed'); } } module.exports = SwipeArcCommand;