UNPKG

@testwizard/commands-mobile

Version:

25 lines (18 loc) 798 B
'use strict'; const CommandBase = require('@testwizard/commands-core').CommandBase; const Result = require('./GetElementAttributeResult'); class GetElementAttributeCommand extends CommandBase { constructor(testObject) { super(testObject, 'Mobile.GetElementAttribute'); } async execute(selector, attribute) { if (selector === undefined) throw new Error('selector is required'); if (attribute === undefined) throw new Error('attribute is required'); var requestObj = [selector, attribute]; var json = await this.executeCommand(requestObj); return new Result(json, 'getElementAttribute was successful', 'getElementAttribute failed'); } } module.exports = GetElementAttributeCommand;