UNPKG

@christian-bromann/webdriverio

Version:

A nodejs bindings implementation for selenium 2.0/webdriver

24 lines (19 loc) 748 B
/** * * Determine if an element is currently displayed. * * @param {String} ID ID of a WebElement JSON object to route the command to * @returns {Boolean} true if the element is displayed * * @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementiddisplayed * @type protocol * */ import { ProtocolError } from '../utils/ErrorHandler' let elementIdDisplayed = function elementIdDisplayed (id) { if (typeof id !== 'string' && typeof id !== 'number') { throw new ProtocolError('number or type of arguments don\'t agree with elementIdDisplayed protocol command') } return this.requestHandler.create(`/session/:sessionId/element/${id}/displayed`) } export default elementIdDisplayed