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