% if (it.hasDocusaurusHeader) { %> --- id: <%= it.command %> title: <%= it.command %> <% if (it.customEditUrl) { %>custom_edit_url: <%= it.customEditUrl %><% } %> --- <% } else if (it.hasHeader) { %> ## <%= it.command %> <% } %> <%= it.description %> <% if (it.deprecated) { %> :::caution <%= it.deprecated %> ::: <% } %> <% if (it.alternativeCommands && it.alternativeCommands.length) { %> :::info This protocol command is embedded in the following convenient method<%= it.alternativeCommands.length > 1 ? 's' : '' %>: <%= it.alternativeCommands.map((command) => `[${command.split('/').pop()}](/docs/api/${command})`).join(', ') %>. It is recommended to use <%= it.alternativeCommands.length > 1 ? 'these commands' : 'this command' %> instead. ::: <% } %> <% if (!it.isSkipUsage) { %> ##### Usage ```js <% if (it.isElementScope) { %> $(selector).<%= it.command %>(<%= it.paramString %>) <% } else if (it.isMockScope) { %> mock.<%= it.command %>(<%= it.paramString %>) <% } else if (it.isDialogScope) { %> await dialog.<%= it.command %>(<%= it.paramString %>) <% } else if (it.isClockScope) { %> const clock = await browser.emulate('clock', { ... }) await clock.<%= it.command %>(<%= it.paramString %>) <% } else { %> <%= it.isMobile ? 'driver' : 'browser' %>.<%= it.command %>(<%= it.paramString %>) <% } %> ``` <% } %> <% if (it.paramTags.length) { %> ##### Parameters
| Name | Type | Details | |||
|---|---|---|---|---|---|
| <%= parts[0] %> <%= parts[1] %> |
<% } else { %>
<%= paramTag.string %> | <% } %>||||
<%= paramTag.name + (paramTag.default ? `=${paramTag.default}` : '') %><% if ((!paramTag.required && typeof paramTag.optional === 'undefined') || paramTag.optional) { %>optional<% } %> |
<%= paramTag.type.split('|').join(', ').replace('(', '').replace(')', '') %> | <%= paramTag.description %> | |||
<%= it.returns.name %>:** <%= it.returns.description %>
<% } %>
<% } %>
<% if (it.throwsTags.length) { %>
##### Throws
<% it.throwsTags.forEach(function(throwsTag) { %>- **<%= throwsTag.type %>**: <%= throwsTag.description %><% }) %>
<% } %>
<% if (it.support && Object.keys(it.support).length) { %>
##### Support
<% Object.keys(it.support).forEach(function(platform) { %>
![Support for <%= Object.keys(it.support[platform]).map(function(driver) {
return driver + " (" + it.support[platform][driver] + ")";
}).join(", ") %>](/img/icons/<%= platform %>.svg)
<% }) %>
<% } %>