appium-lg-webos-driver
Version:
LG WebOS support for Appium
372 lines • 12.9 kB
TypeScript
export { KEYS } from "./keys";
export const DEFAULT_PRESS_DURATION_MS: 100;
/**
* @extends {BaseDriver<WebOsConstraints>}
*/
export class WebOSDriver extends BaseDriver<Readonly<{
readonly platformName: {
readonly isString: true;
readonly inclusionCaseInsensitive: readonly ["LGTV"];
readonly presence: true;
};
readonly deviceName: {
readonly isString: true;
readonly presence: true;
};
readonly deviceHost: {
readonly isString: true;
readonly presence: true;
};
readonly app: {
readonly isString: true;
};
readonly appId: {
readonly isString: true;
readonly presence: true;
};
readonly debuggerPort: {
readonly isNumber: true;
};
readonly websocketPort: {
readonly isNumber: true;
};
readonly websocketPortSecure: {
readonly isNumber: true;
};
readonly useSecureWebsocket: {
readonly isBoolean: true;
};
readonly chromedriverExecutable: {
readonly isString: true;
};
readonly chromedriverExecutableDir: {
readonly isString: true;
};
readonly autoExtendDevMode: {
readonly isBoolean: true;
};
readonly appLaunchParams: {
readonly isObject: true;
};
readonly appLaunchCooldown: {
readonly isNumber: true;
};
readonly remoteOnly: {
readonly isBoolean: true;
};
readonly rcMode: {
readonly isString: true;
readonly inclusionCaseInsensitive: readonly ["rc", "js"];
};
readonly keyCooldown: {
readonly isNumber: true;
};
readonly showChromedriverLog: {
readonly isBoolean: true;
};
}>> {
static executeMethodMap: {
'webos: pressKey': Readonly<{
command: "pressKey";
params: {
required: string[];
optional: string[];
};
}>;
'webos: listApps': Readonly<{
command: "listApps";
}>;
'webos: activeAppInfo': Readonly<{
command: "getCurrentForegroundAppInfo";
}>;
};
/**
*
* @param {any} name
* @returns {name is ScriptId}
*/
static isExecuteScript(name: any): name is "webos: pressKey" | "webos: listApps" | "webos: activeAppInfo";
constructor(...arguments_: any[]);
/** @type {RouteMatcher[]} */
jwpProxyAvoid: import("@appium/types").RouteMatcher[];
/** @type {boolean} */
jwpProxyActive: boolean;
/** @type {LGWSClient|undefined} */
socketClient: LGWSClient | undefined;
/** @type {import('./remote/lg-remote-client').LGRemoteClient|undefined} */
remoteClient: import('./remote/lg-remote-client').LGRemoteClient | undefined;
desiredCapConstraints: Readonly<{
readonly platformName: {
readonly isString: true;
readonly inclusionCaseInsensitive: readonly ["LGTV"];
readonly presence: true;
};
readonly deviceName: {
readonly isString: true;
readonly presence: true;
};
readonly deviceHost: {
readonly isString: true;
readonly presence: true;
};
readonly app: {
readonly isString: true;
};
readonly appId: {
readonly isString: true;
readonly presence: true;
};
readonly debuggerPort: {
readonly isNumber: true;
};
readonly websocketPort: {
readonly isNumber: true;
};
readonly websocketPortSecure: {
readonly isNumber: true;
};
readonly useSecureWebsocket: {
readonly isBoolean: true;
};
readonly chromedriverExecutable: {
readonly isString: true;
};
readonly chromedriverExecutableDir: {
readonly isString: true;
};
readonly autoExtendDevMode: {
readonly isBoolean: true;
};
readonly appLaunchParams: {
readonly isObject: true;
};
readonly appLaunchCooldown: {
readonly isNumber: true;
};
readonly remoteOnly: {
readonly isBoolean: true;
};
readonly rcMode: {
readonly isString: true;
readonly inclusionCaseInsensitive: readonly ["rc", "js"];
};
readonly keyCooldown: {
readonly isNumber: true;
};
readonly showChromedriverLog: {
readonly isBoolean: true;
};
}>;
/**
* @param {W3CWebOsCaps} w3cCaps1
* @param {W3CWebOsCaps} w3cCaps2
* @param {W3CWebOsCaps} w3cCaps3
* @returns {Promise<[string,WebOsCaps]>}
*/
createSession(w3cCaps1: W3CWebOsCaps, w3cCaps2: W3CWebOsCaps, w3cCaps3: W3CWebOsCaps): Promise<[string, Partial<import("@appium/types").ConstraintsToCaps<typeof import("@appium/types").BASE_DESIRED_CAP_CONSTRAINTS & Readonly<{
readonly platformName: {
readonly isString: true;
readonly inclusionCaseInsensitive: readonly ["LGTV"];
readonly presence: true;
};
readonly deviceName: {
readonly isString: true;
readonly presence: true;
};
readonly deviceHost: {
readonly isString: true;
readonly presence: true;
};
readonly app: {
readonly isString: true;
};
readonly appId: {
readonly isString: true;
readonly presence: true;
};
readonly debuggerPort: {
readonly isNumber: true;
};
readonly websocketPort: {
readonly isNumber: true;
};
readonly websocketPortSecure: {
readonly isNumber: true;
};
readonly useSecureWebsocket: {
readonly isBoolean: true;
};
readonly chromedriverExecutable: {
readonly isString: true;
};
readonly chromedriverExecutableDir: {
readonly isString: true;
};
readonly autoExtendDevMode: {
readonly isBoolean: true;
};
readonly appLaunchParams: {
readonly isObject: true;
};
readonly appLaunchCooldown: {
readonly isNumber: true;
};
readonly remoteOnly: {
readonly isBoolean: true;
};
readonly rcMode: {
readonly isString: true;
readonly inclusionCaseInsensitive: readonly ["rc", "js"];
};
readonly keyCooldown: {
readonly isNumber: true;
};
readonly showChromedriverLog: {
readonly isBoolean: true;
};
}>> & import("./types").ExtraWebOsCaps>]>;
valueBox: ValueBox | undefined;
/**
* @typedef BrowserVersionInfo
* @property {string} Browser
* @property {string} Protocol-Version
* @property {string} User-Agent
* @property {string} [V8-Version]
* @property {string} WebKit-Version
* @property {string} [webSocketDebuggerUrl]
*/
/**
* Use UserAgent info for "Browser" if the chrome response did not include
* browser name properly.
* @param {BrowserVersionInfo} browserVersionInfo
* @return {BrowserVersionInfo}
*/
useUAForBrowserIfNotPresent(browserVersionInfo: {
Browser: string;
"Protocol-Version": string;
"User-Agent": string;
"V8-Version"?: string | undefined;
"WebKit-Version": string;
webSocketDebuggerUrl?: string | undefined;
}): {
Browser: string;
"Protocol-Version": string;
"User-Agent": string;
"V8-Version"?: string | undefined;
"WebKit-Version": string;
webSocketDebuggerUrl?: string | undefined;
};
/**
* Set chrome version v63.0.3239.0 as the minimal version
* for autodownload to use proper chromedriver version if
* - the 'Browser' info does not have proper chrome version, or
* - older than the chromedriver version could raise no Chrome binary found error,
* which no makes sense for TV automation usage.
*
* @param {BrowserVersionInfo} browserVersionInfo
* @return {BrowserVersionInfo}
*/
fixChromeVersionForAutodownload(browserVersionInfo: {
Browser: string;
"Protocol-Version": string;
"User-Agent": string;
"V8-Version"?: string | undefined;
"WebKit-Version": string;
webSocketDebuggerUrl?: string | undefined;
}): {
Browser: string;
"Protocol-Version": string;
"User-Agent": string;
"V8-Version"?: string | undefined;
"WebKit-Version": string;
webSocketDebuggerUrl?: string | undefined;
};
/**
* @param {StartChromedriverOptions} opts
*/
startChromedriver({ debuggerHost, debuggerPort, executable, executableDir, isAutodownloadEnabled, verbose }: StartChromedriverOptions): Promise<void>;
proxyReqRes: any;
/**
* Execute some arbitrary JS via Chromedriver.
* @template [TReturn=any]
* @template [TArg=any]
* @param {((...args: any[]) => TReturn)|string} script
* @param {TArg[]} [args]
* @returns {Promise<{value: TReturn}>}
*/
executeChromedriverScript<TReturn = any, TArg = any>(script: string | ((...args: any[]) => TReturn), args?: TArg[] | undefined): Promise<{
value: TReturn;
}>;
/**
* Given a script of {@linkcode ScriptId} or some arbitrary JS, figure out
* which it is and run it.
*
* @template [TArg=any]
* @template [TReturn=unknown]
* @template {import('type-fest').LiteralUnion<ScriptId, string>} [S=string]
* @param {S} script
* @param {S extends ScriptId ? [Record<string,any>] : TArg[]} args
* @returns {Promise<S extends ScriptId ? import('type-fest').AsyncReturnType<ExecuteMethod<S>> : {value: TReturn}>}
*/
execute<TArg_1 = any, TReturn_1 = unknown, S extends import("type-fest").LiteralUnion<"webos: pressKey" | "webos: listApps" | "webos: activeAppInfo", string> = string>(script: S, args: S extends "webos: pressKey" | "webos: listApps" | "webos: activeAppInfo" ? [Record<string, any>] : TArg_1[]): Promise<S extends "webos: pressKey" | "webos: listApps" | "webos: activeAppInfo" ? Awaited<ReturnType<ExecuteMethod<S>>> : {
value: TReturn_1;
}>;
/**
*
* @param {string} sessionId
* @param {import('@appium/types').DriverData[]} [driverData]
*/
deleteSession(sessionId: string, driverData?: import("@appium/types").DriverData[] | undefined): Promise<void>;
proxyActive(): boolean;
getProxyAvoidList(): import("@appium/types").RouteMatcher[];
canProxy(): boolean;
/**
* Automates a keypress
* @param {import('./keys').KnownKey} key
* @param {number} [duration]
*/
pressKey(key: import('./keys').KnownKey, duration?: number | undefined): Promise<any>;
/**
* Automates a press of a button on a remote control.
* @param {string} key
*/
pressKeyViaRemote(key: string): Promise<any>;
/**
*
* @returns {Promise<[object]>} Return the list of installed applications
*/
listApps(): Promise<[object]>;
/**
*
* @returns {Promise<object>} Return current active application information.
*/
getCurrentForegroundAppInfo(): Promise<object>;
/**
* A dummy implementation to return 200 ok with NATIVE_APP context for
* webdriverio compatibility. https://github.com/headspinio/appium-roku-driver/issues/175
*
* @returns {Promise<string>}
*/
getCurrentContext(): Promise<string>;
#private;
}
export type WebOSCapabilities = import('./types').ExtraWebOsCaps;
export type WebOsConstraints = import('./constraints').WebOsConstraints;
export type Key = import('./keys').KnownKey;
export type StartChromedriverOptions = import('./types').StartChromedriverOptions;
export type WebOsCaps = import('@appium/types').DriverCaps<WebOsConstraints, WebOSCapabilities>;
export type W3CWebOsCaps = import('@appium/types').W3CDriverCaps<WebOsConstraints, WebOSCapabilities>;
export type RouteMatcher = import('@appium/types').RouteMatcher;
export type WebOSDriverExecuteMethodMap = typeof WebOSDriver.executeMethodMap;
/**
* A known script identifier (e.g., `tizen: pressKey`)
*/
export type ScriptId = keyof WebOSDriverExecuteMethodMap;
/**
* Lookup a method by its script ID.
*/
export type ExecuteMethod<S extends "webos: pressKey" | "webos: listApps" | "webos: activeAppInfo"> = WebOSDriver[WebOSDriverExecuteMethodMap[S]['command']];
import { BaseDriver } from "@appium/base-driver";
import { LGWSClient } from "./remote/lg-socket-client";
import { ValueBox } from "./remote/valuebox";
//# sourceMappingURL=driver.d.ts.map