UNPKG

@testwizard/commands-mobile

Version:

23 lines (16 loc) 681 B
'use strict'; const CommandBase = require('@testwizard/commands-core').CommandBase; const Result = require('./GetElementLocationResult'); class GetElementLocationCommand extends CommandBase { constructor(testObject) { super(testObject, 'Mobile.GetElementLocation'); } async execute(selector) { if (selector === undefined) throw new Error('selector is required'); const requestObj = [selector]; const json = await this.executeCommand(requestObj); return new Result(json, 'getElementLocation was successful', 'getElementLocation failed'); } } module.exports = GetElementLocationCommand;