UNPKG

@testim/testim-cli

Version:

Command line interface for running Testing on you CI

27 lines (20 loc) 801 B
/** * * Determine if an element is currently enabled. * * @param {String} ID ID of a WebElement JSON object to route the command to * @returns {Boolean} true if the element is enabled * * @see https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/enabled * @type protocol * */ var ErrorHandler = require('../utils/ErrorHandler.js'); module.exports = function elementIdEnabled (id) { if(typeof id !== 'string' && typeof id !== 'number') { throw new ErrorHandler.ProtocolError('number or type of arguments don\'t agree with elementIdEnabled protocol command'); } var requestPath = '/session/:sessionId/element/:id/enabled'; requestPath = requestPath.replace(/:id/gi, id); return this.requestHandler.create(requestPath); };