Implementation:Webdriverio Webdriverio Appium Types
| Knowledge Sources | |
|---|---|
| Domains | Mobile_Testing, Type_Definitions |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
The Appium Types module defines TypeScript type definitions for Appium server arguments, session capabilities, and service configuration.
Description
This module contains three primary type definitions. AppiumServerArguments maps all supported Appium server CLI flags (port, basePath, address, logging options, security settings, plugins, and more) as a typed object. AppiumSessionCapabilities defines default session connection parameters (port, protocol, hostname, path). AppiumServiceConfig is the main configuration interface for the service, including logPath, command, args, appiumStartTimeout, and the trackSelectorPerformance object with its sub-options for enabling CLI/markdown reports, setting report paths, and configuring page object search directories.
Usage
These types are imported throughout the Appium service package to type-check configuration objects, constructor parameters, and function signatures.
Code Reference
Source Location
- Repository: Webdriverio_Webdriverio
- File: packages/wdio-appium-service/src/types.ts
- Lines: 1-198
Signature
export type AppiumServerArguments = {
address?: string
allowCors?: boolean
allowInsecure?: string
basePath?: string
callbackAddress?: string
callbackPort?: number | string
debugLogSpacing?: boolean
defaultCapabilities?: object
denyInsecure?: string
keepAliveTimeout?: number | string
localTimezone?: boolean
log?: string
logFilters?: string
logLevel?: string
logNoColors?: boolean
logTimestamp?: boolean
longStacktrace?: boolean
noPermsCheck?: boolean
nodeconfig?: string | object
port?: number | string
relaxedSecurity?: boolean
sessionOverride?: boolean
strictCaps?: boolean
tmp?: string
traceDir?: string
useDrivers?: string
usePlugins?: string
webhook?: string
}
export interface AppiumSessionCapabilities {
port?: number
protocol?: string
hostname?: string
path?: string
}
export interface AppiumServiceConfig {
logPath?: string
command?: string
args?: AppiumServerArguments
appiumStartTimeout?: number
trackSelectorPerformance?: {
enableCliReport?: boolean
enableMarkdownReport?: boolean
reportPath?: string
maxLineLength?: number
pageObjectPaths: string[]
}
}
export type ArgValue = string | number | boolean | null | object
export type KeyValueArgs = { [key: string]: ArgValue }
Import
import type { AppiumServerArguments, AppiumSessionCapabilities, AppiumServiceConfig } from './types.js'
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| N/A | N/A | N/A | This module only exports types and does not accept runtime inputs |
Outputs
| Name | Type | Description |
|---|---|---|
| AppiumServerArguments | type |
Type representing all Appium server CLI arguments as an object with optional string, number, boolean, and object properties |
| AppiumSessionCapabilities | interface |
Interface for default session connection parameters |
| AppiumServiceConfig | interface |
Interface for the complete Appium service configuration including selector performance tracking options |
| ArgValue | type |
Union type for CLI argument values |
| KeyValueArgs | type |
Record type mapping string keys to ArgValue values |
Usage Examples
Typing a Service Configuration
import type { AppiumServiceConfig } from './types.js'
const config: AppiumServiceConfig = {
logPath: './logs',
command: 'appium',
args: {
port: 4723,
basePath: '/',
allowCors: true
},
appiumStartTimeout: 60000,
trackSelectorPerformance: {
pageObjectPaths: ['./tests/pageobjects'],
enableCliReport: true,
enableMarkdownReport: true,
reportPath: './reports/performance',
maxLineLength: 120
}
}
Typing Server Arguments
import type { AppiumServerArguments } from './types.js'
const serverArgs: AppiumServerArguments = {
port: 4723,
basePath: '/',
logLevel: 'info',
useDrivers: 'xcuitest',
usePlugins: 'inspector',
relaxedSecurity: true
}