Add index for API docs
ADD
commands-yml/api-template.md
+## Appium API Documentation
+
+<div class="api-index">
+{{#*inline "commands"}}
+ {{#each commands}}
+ <li>
+ {{#if path}}<a href='{{path}}'>{{name}}</a>{{else}}{{name}}<ul>{{>commands}}</ul>{{/if}}
+ </li>
+ {{/each}}
+{{/inline}}
+
+<ul>
+{{>commands}}
+</ul>
+</div>

MODIFY
commands-yml/commands/element/find-elements.yml
commands-yml/commands/element/find-elements.yml
@@ -3,7 +3,7 @@ name: Find Elements
short_description: Search for multiple elements
description:
>
- Get a list of elements that match the [locator selector](/docs/en/writing-running-appium/finding-elements/).
+ Get a list of elements that match the [locator selector](/docs/en/writing-running-appium/finding-elements.md).
selector_strategies:
- name: Accessibility ID
description: Read a unique identifier for a UI element. For XCUITest it is the element's `resource-id` attribute. For Android it is the element's `content-desc` attribute.

MODIFY
commands-yml/parse.js
commands-yml/parse.js
@@ -102,7 +102,7 @@ Handlebars.registerHelper('base_url', function (fullUrl) {
return baseUrl.hostname;
});
-async function main () {
+async function generateCommands () {
const commands = path.resolve(__dirname, 'commands/**/*.yml');
console.log('Traversing YML files', commands);
await fs.rimraf(path.resolve(__dirname, '..', 'docs', 'en', 'commands'));
@@ -134,5 +134,45 @@ async function main () {
console.log(`Done writing ${fileCount} command documents`);
}
+async function generateCommandIndex () {
+ const apiIndex = path.resolve(__dirname, '..', 'docs', 'en', 'about-appium', 'api.md');
+ console.log(`Creating API index '${apiIndex}'`);
+
+ function getTree (element, path) {
+ let node = {
+ name: element[0],
+ };
+ if (!_.isArray(element[1])) {
+ node.path = `${path}/${element[1]}`;
+ } else {
+ const name = element[1].shift();
+ node.commands = [];
+ for (let subElement of element[1]) {
+ node.commands.push(getTree(subElement, `${path}/${name}`));
+ }
+ }
+ return node;
+ }
+
+ // parse the toc.js file and get the commands into the form of
+ // {commands: [{name: '', path: ''}, {name: '', commands: [...]}]}
+ const toc = require(path.resolve(__dirname, '..', 'docs', 'toc.js'));
+ const commandToc = _.find(toc.en, (value) => value.indexOf('Commands') === 0);
+ let commands = [];
+ for (let el of commandToc[1].slice(1)) {
+ commands.push(getTree(el, '/docs/en/commands'));
+ }
+
+ const template = Handlebars.compile(await fs.readFile(path.resolve(__dirname, 'api-template.md'), 'utf8'), {noEscape: true, strict: true});
+ const markdown = template({commands});
+ await fs.writeFile(apiIndex, markdown, 'utf8');
+ console.log(`Done writing API index`);
+}
+
+async function main () {
+ await generateCommands();
+ await generateCommandIndex();
+}
+
asyncify(main);
/* eslint-enable */

ADD
docs/en/about-appium/api.md
+## Appium API Documentation
+
+<div class="api-index">
+
+<ul>
+ <li>
+ <a href='/docs/en/commands/status.md'>Status</a>
+ </li>
+ <li>
+ Session<ul> <li>
+ <a href='/docs/en/commands/session/create.md'>Create</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/delete.md'>End</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/get.md'>Get Session Capabilities</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/back.md'>Go Back</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/screenshot.md'>Screenshot</a>
+ </li>
+ <li>
+ Timeouts<ul> <li>
+ <a href='/docs/en/commands/session/timeouts/timeouts.md'>Timeouts</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/timeouts/implicit-wait.md'>Implicit Wait</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/timeouts/async-script.md'>Async Script</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Orientation<ul> <li>
+ <a href='/docs/en/commands/session/orientation/get-orientation.md'>Get Orientation</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/orientation/set-orientation.md'>Set Orientation</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Geolocation<ul> <li>
+ <a href='/docs/en/commands/session/geolocation/get-geolocation.md'>Get Geolocation</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/geolocation/set-geolocation.md'>Set Geolocation</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Logs<ul> <li>
+ <a href='/docs/en/commands/session/logs/get-log-types.md'>Get Log Types</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/logs/get-log.md'>Get Logs</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Settings<ul> <li>
+ <a href='/docs/en/commands/session/settings/update-settings.md'>Update Settings</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/session/settings/get-settings.md'>Get Device Settings</a>
+ </li>
+</ul>
+ </li>
+</ul>
+ </li>
+ <li>
+ Device<ul> <li>
+ Activity<ul> <li>
+ <a href='/docs/en/commands/device/activity/start-activity.md'>Start Activity</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/activity/current-activity.md'>Current Activity</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/activity/current-package.md'>Current Package</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ App<ul> <li>
+ <a href='/docs/en/commands/device/app/install-app.md'>Install App</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/is-app-installed.md'>Is App Installed</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/launch-app.md'>Launch App</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/background-app.md'>Background App</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/close-app.md'>Close App</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/reset-app.md'>Reset App</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/remove-app.md'>Remove App</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/get-app-strings.md'>Get App Strings</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/app/end-test-coverage.md'>End Test Coverage</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Files<ul> <li>
+ <a href='/docs/en/commands/device/files/push-file.md'>Push File</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/files/pull-file.md'>Pull File</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/files/pull-folder.md'>Pull Folder</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Interactions<ul> <li>
+ <a href='/docs/en/commands/device/interactions/shake.md'>Shake</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/interactions/lock.md'>Lock</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/interactions/unlock.md'>Unlock</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/interactions/is-locked.md'>Is Locked</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/interactions/rotate.md'>Rotate</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Keys<ul> <li>
+ <a href='/docs/en/commands/device/keys/press-keycode.md'>Press keycode</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/keys/long-press-keycode.md'>Long press keycode</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/keys/hide-keyboard.md'>Hide Keyboard</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/keys/is-keyboard-shown.md'>Is Keyboard Shown</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Network<ul> <li>
+ <a href='/docs/en/commands/device/network/toggle-airplane-mode.md'>Toggle Airplane Mode</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/network/toggle-data.md'>Toggle Data</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/network/toggle-wifi.md'>Toggle WiFi</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/network/toggle-location-services.md'>Toggle Location Services</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/network/send-sms.md'>Send SMS</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/network/gsm-call.md'>GSM Call</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/network/gsm-signal.md'>GSM Signal</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/network/gsm-voice.md'>GSM Voice</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Performance Data<ul> <li>
+ <a href='/docs/en/commands/device/performance-data/get-performance-data.md'>Get Performance Data</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/performance-data/performance-data-types.md'>Performance Data Types</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Simulator<ul> <li>
+ <a href='/docs/en/commands/device/simulator/touch-id.md'>Perform Touch ID</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/simulator/toggle-touch-id-enrollment.md'>Toggle Touch ID Enrollment</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ System<ul> <li>
+ <a href='/docs/en/commands/device/system/open-notifications.md'>Open Notifications</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/system/system-bars.md'>System Bars</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/device/system/system-time.md'>System Time</a>
+ </li>
+</ul>
+ </li>
+</ul>
+ </li>
+ <li>
+ Element<ul> <li>
+ <a href='/docs/en/commands/element/find-element.md'>Find Element</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/find-elements.md'>Find Elements</a>
+ </li>
+ <li>
+ Actions<ul> <li>
+ <a href='/docs/en/commands/element/actions/click.md'>Click</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/actions/send-keys.md'>Send Keys</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/actions/clear.md'>Clear</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Attributes<ul> <li>
+ <a href='/docs/en/commands/element/attributes/text.md'>Text</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/name.md'>Name</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/attribute.md'>Attribute</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/selected.md'>Selected</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/enabled.md'>Enabled</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/enabled.md'>Displayed</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/location.md'>Location</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/size.md'>Size</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/rect.md'>Rect</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/css-property.md'>CSS Property</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/attributes/location-in-view.md'>Location in View</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Other<ul> <li>
+ <a href='/docs/en/commands/element/other/submit.md'>Submit</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/other/active.md'>Active Element</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/element/other/equals-element.md'>Equals Element</a>
+ </li>
+</ul>
+ </li>
+</ul>
+ </li>
+ <li>
+ Context<ul> <li>
+ <a href='/docs/en/commands/context/get-context.md'>Get Context</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/context/get-contexts.md'>Get All Contexts</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/context/set-context.md'>Set Context</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Interactions<ul> <li>
+ Mouse<ul> <li>
+ <a href='/docs/en/commands/interactions/mouse/moveto.md'>Move To</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/mouse/click.md'>Click</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/mouse/doubleclick.md'>Double Click</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/mouse/button-down.md'>Button Down</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/mouse/button-up.md'>Button Up</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Touch<ul> <li>
+ <a href='/docs/en/commands/interactions/touch/tap.md'>Single Tap</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/double-tap.md'>Double Tap</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/move.md'>Move</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/touch-down.md'>Touch Down</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/touch-up.md'>Touch Up</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/long-press.md'>Long Press</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/scroll.md'>Scroll</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/flick.md'>Flick</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/multi-touch-perform.md'>Multi Touch Perform</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/interactions/touch/touch-perform.md'>Touch Perform</a>
+ </li>
+</ul>
+ </li>
+</ul>
+ </li>
+ <li>
+ Web<ul> <li>
+ Window<ul> <li>
+ <a href='/docs/en/commands/web/window/set-window.md'>Set Window</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/close-window.md'>Close Window</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/get-handle.md'>Get Handle</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/get-handles.md'>Get Handles</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/title.md'>Get Title</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/get-window-size.md'>Get Window Size</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/set-window-size.md'>Set Window Size</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/get-window-position.md'>Get Window Position</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/set-window-position.md'>Set Window Position</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/window/maximize-window.md'>Maximize Window</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Navigation<ul> <li>
+ <a href='/docs/en/commands/web/navigation/go-to-url.md'>Go to URL</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/navigation/url.md'>Get URL</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/navigation/back.md'>Back</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/navigation/forward.md'>Forward</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/navigation/refresh.md'>Refresh</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Storage<ul> <li>
+ <a href='/docs/en/commands/web/storage/get-all-cookies.md'>Get All Cookies</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/storage/set-cookie.md'>Set Cookie</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/storage/delete-cookie.md'>Delete Cookie</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/storage/delete-all-cookies.md'>Delete All Cookies</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ Frame<ul> <li>
+ <a href='/docs/en/commands/web/frame/switch.md'>Switch to Frame</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/frame/parent.md'>Switch to Parent Frame</a>
+ </li>
+</ul>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/execute-async.md'>Execute Async</a>
+ </li>
+ <li>
+ <a href='/docs/en/commands/web/execute.md'>Execute</a>
+ </li>
+</ul>
+ </li>
+</ul>
+</div>

MODIFY
docs/en/commands/element/find-elements.md
docs/en/commands/element/find-elements.md
@@ -60,7 +60,7 @@ $els = $this->elements($this->using('accessibility id')->value('SomeAccessibilit
## Description
-Get a list of elements that match the [locator selector](/docs/en/about-appium/getting-started.md).
+Get a list of elements that match the [locator selector](/docs/en/writing-running-appium/finding-elements.md).
## Support

MODIFY
docs/toc.js
docs/toc.js
@@ -5,7 +5,9 @@ module.exports = {
["Introduction", "intro.md"],
["The Appium Clients", "appium-clients.md"],
["Getting Started", "getting-started.md"],
- ["Supported Platforms", "platform-support.md"]]],
+ ["Supported Platforms", "platform-support.md"],
+ ["API Documentation", "api.md"],
+ ]],
["Drivers", ["drivers",
["XCUITest (iOS)", "ios-xcuitest.md"],
["XCUITest Real Devices (iOS)", "ios-xcuitest-real-devices.md"],
@@ -47,7 +49,6 @@ module.exports = {
["Update Settings", "update-settings.md"],
["Get Device Settings", "get-settings.md"],
]],
- /* ["Receive Async Response", "receive-async-response.md"], */
]],
["Device", ["device",
["Activity", ["activity",
@@ -193,7 +194,7 @@ module.exports = {
]],
["Execute Async", "execute-async.md"],
["Execute", "execute.md"],
- ]]
+ ]],
]],
["Writing & Running Tests", ["writing-running-appium",
["Running Tests", "running-tests.md"],

Add index for API docs