@testwizard/commands-mobile
Version:
23 lines (16 loc) • 665 B
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = Commands.ResultForOkAndErrorMessage;
class SetOrientationCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'Mobile.SetOrientation');
}
async execute(orientation) {
if (orientation === undefined)
throw new Error('orientation is required');
const requestObj = [orientation];
const json = await this.executeCommand(requestObj);
return new Result(json, 'setOrientation was successful', 'setOrientation failed');
}
}
module.exports = SetOrientationCommand;