Skip to main content

@svatah/yam-adapter-appium

Appium adapter: Android Chrome and native

Exports

ExportKindSignature
APPIUM_ADAPTER_NAMEvariableAPPIUM_ADAPTER_NAME = "appium"The name this adapter is selected by in yam.config.yaml (LLD §2.4).
APPIUM_CAPABILITIESvariableAPPIUM_CAPABILITIES: Capabilities What this adapter can do (LLD §2.4).
APPIUM_CAPS_ENVvariableAPPIUM_CAPS_ENV = "YAM_APPIUM_CAPS"YAM_APPIUM_CAPS: a JSON object of capabilities, merged over the config's.
APPIUM_URL_ENVvariableAPPIUM_URL_ENV = "YAM_APPIUM_URL"YAM_APPIUM_URL: where the Appium server is listening.
AppiumAdapterOptionsinterfaceexport interface AppiumAdapterOptions
AppiumCheckContextinterfaceexport interface AppiumCheckContext
AppiumClientinterfaceexport interface AppiumClientThe W3C WebDriver commands this adapter uses.
AppiumConnectOptionsinterfaceexport interface AppiumConnectOptions
appiumServerUrlfunctionexport function appiumServerUrl(Where the Appium server is, from the flag layer, the environment, or the default.
AppiumSurfaceclassexport class AppiumSurface implements AgentSurface
appiumUnreachablefunctionexport function appiumUnreachable(url: string, cause: unknown): SessionErrorTypeThe message a person can act on when there is no Appium server.
boxOffunctionexport function boxOf(node: SourceNode): [number, number, number, number] | undefined
capabilitiesFromEnvfunctionexport function capabilitiesFromEnv(env: NodeJS.ProcessEnv = process.env): Record<string, unknown>Capabilities the environment adds or overrides.
classesForRolefunctionexport function classesForRole(role: string): string[]The native classes that map onto an ARIA role.
connectWebdriverIofunctionexport async function connectWebdriverIo(options: AppiumConnectOptions): Promise<AppiumClient>Connect through WebdriverIO (LLD §7.4).
ConvertedNodeinterfaceexport interface ConvertedNode extends SnapshotNode
ConvertOptionsinterfaceexport interface ConvertOptions
convertPageSourcefunctionexport function convertPageSource(A page source, as the normalised node list of LLD §2.2.
createAppiumSurfacefunctionexport function createAppiumSurface(Build a surface from a project config (LLD §2.4).
DEFAULT_APPIUM_URLvariableDEFAULT_APPIUM_URL = "http://127.0.0.1:4723"
ElementIdtypealiasexport type ElementId = string;An element the driver found: the opaque id the protocol hands back.
evaluateAppiumPredicatefunctionexport async function evaluateAppiumPredicate(
isNativeContextfunctionexport function isNativeContext(context: string): booleanWhich context a name refers to: Appium calls the native one NATIVE_APP.
literalValuefunctionexport function literalValue(ref: ValueRef): stringThe literal a ValueRef names; an unresolved one is a caller mistake (LLD §8.2).
maskPngfunctionexport function maskPng(Paint solid rectangles over a PNG.
nameOffunctionexport function nameOf(node: SourceNode): stringThe accessible name: content-desc, then text, then iOS's label or name.
nativeStrategyfunctionexport function nativeStrategy(candidate: Candidate): StrategyThe strategy for a candidate in a native context.
parseBoundsfunctionexport function parseBounds(bounds: string | undefined): [number, number, number, number] | undefined[x, y, width, height] from Android's [left,top][right,bottom].
parsePageSourcefunctionexport function parsePageSource(xml: string): SourceNodeParse a page source into a tree.
registerAppiumAdapterfunctionexport function registerAppiumAdapter(): voidRegister the adapter. Idempotent, because the registry refuses a silent
roleOffunctionexport function roleOf(node: SourceNode): stringThe role a native class means, in the ARIA vocabulary (REQ-SURF-4).
SourceNodeinterfaceexport interface SourceNodeOne element as the page source describes it, before any normalisation.
statesOffunctionexport function statesOf(node: SourceNode): SnapshotNode["states"]The states LLD §2.2 publishes, read from the platform's boolean attributes.
Strategyinterfaceexport interface StrategyOne W3C using / value pair, as POST /session/:id/elements takes it.
strategyForfunctionexport function strategyFor(The strategy for a candidate, given which context the session is in.
unescapeXmlfunctionexport function unescapeXml(value: string): stringThe five XML entities, plus the numeric escapes a label can contain.
UnsupportedPngclassexport class UnsupportedPng extends ErrorWhat this masker can rewrite, and why anything else is refused.
valueOffunctionexport function valueOf(node: SourceNode): string | undefinedThe value a control holds, as distinct from what it is called.
WebdriverIoBrowserinterfaceexport interface WebdriverIoBrowserThe WebdriverIO surface this adapter uses, as a structural type.
webdriverIoClientfunctionexport function webdriverIoClient(browser: WebdriverIoBrowser): AppiumClientAppiumClient over a WebdriverIO browser object.
webviewStrategyfunctionexport function webviewStrategy(The strategy for a candidate in a webview context.
xpathLiteralfunctionexport function xpathLiteral(value: string): stringQuote a value for an XPath predicate, including one that contains quotes.
xpathOffunctionexport function xpathOf(path: readonly SourceNode[]): stringThe XPath that names one node from the root, by class and sibling index.