UNPKG

appium-android-driver

Version:

Android UiAutomator and Chrome support for Appium

67 lines 2.77 kB
import type { EventEmitter } from 'node:events'; import { type LogEntry } from '../utils'; import type { AndroidDriver } from '../driver'; export declare const supportedLogTypes: { readonly logcat: { readonly description: "Logs for Android applications on real device and emulators via ADB"; readonly getter: (self: AndroidDriver) => LogEntry[]; }; readonly bugreport: { readonly description: "'adb bugreport' output for advanced issues diagnostic"; readonly getter: (self: AndroidDriver) => Promise<LogEntry[]>; }; readonly server: { readonly description: "Appium server logs"; readonly getter: (self: AndroidDriver) => LogEntry[]; }; }; /** * Starts Android logcat broadcast websocket on the same host and port * where Appium server is running at `/ws/session/:sessionId:/appium/logcat` endpoint. The method * will return immediately if the web socket is already listening. * * Each connected websocket listener will receive logcat log lines * as soon as they are visible to Appium. * * @returns Promise that resolves when the logcat broadcasting websocket is started. */ export declare function mobileStartLogsBroadcast(this: AndroidDriver): Promise<void>; /** * Stops the previously started logcat broadcasting wesocket server. * This method will return immediately if no server is running. * * @returns Promise that resolves when the logcat broadcasting websocket is stopped. */ export declare function mobileStopLogsBroadcast(this: AndroidDriver): Promise<void>; /** * Gets the list of available log types. * * @returns Promise that resolves to an array of log type names. */ export declare function getLogTypes(this: AndroidDriver): Promise<string[]>; /** * Assigns a BiDi log listener to an event emitter. * * https://w3c.github.io/webdriver-bidi/#event-log-entryAdded * * @template EE The event emitter type. * @param logEmitter The event emitter to attach the listener to. * @param properties The BiDi listener properties. * @returns A tuple containing the event emitter and the listener function. */ export declare function assignBiDiLogListener<EE extends EventEmitter>(this: AndroidDriver, logEmitter: EE, properties: BiDiListenerProperties): [EE, LogListener]; /** * Gets logs of a specific type. * * @param logType The type of logs to retrieve. * @returns Promise that resolves to the logs for the specified type. */ export declare function getLog(this: AndroidDriver, logType: string): Promise<any>; export interface BiDiListenerProperties { type: string; srcEventName?: string; context?: string; entryTransformer?: (x: LogEntry) => LogEntry; } export type LogListener = (logEntry: LogEntry) => any; //# sourceMappingURL=log.d.ts.map