/** * Constant for "rc" text input mode, which uses the Tizen Remote Control API */ export const TEXT_STRATEGY_REMOTE: "rc"; /** * Constant for "proxy" text input mode, which uses Chromedriver */ export const TEXT_STRATEGY_PROXY: "proxy"; /** * Constant for "js" RC mode, which uses Chromedriver to mimic keypressed */ export const RC_MODE_JS: "js"; /** * Constant for "remote" RC mode, which uses the Tizen Remote Control API */ export const RC_MODE_REMOTE: "remote"; /** * Platform name of this Driver. Defined in `package.json` */ export const PLATFORM_NAME: "TizenTV"; /** * Default duration of a "regular" keypress in ms. */ export const DEFAULT_KEYPRESS_DELAY: 200; /** * Default duration of a "long" keypress in ms. */ export const DEFAULT_LONG_KEYPRESS_DELAY: 1000; /** * We wait this many ms for the `KeyboardEvent` to propagate from the websocket * API to the AUT */ export const DEFAULT_RC_KEYPRESS_COOLDOWN: 750; /** * Port of websocket server on device; used in "remote" RC mode. */ export const RC_PORT: 8002; /** * "Name" */ export const RC_NAME: "Appium"; export namespace RC_OPTS { export { RC_PORT as port }; export { RC_NAME as name }; } /** * A known script identifier (e.g., `tizen: pressKey`) */ export type ScriptId = keyof TizenTVDriverExecuteMethodMap; /** * Capabilities for {@linkcode TizenTVDriver} */ export type TizenTVDriverCaps = import("@appium/types").DriverCaps; /** * W3C-style caps for {@linkcode TizenTVDriver} */ export type W3CTizenTVDriverCaps = import("@appium/types").W3CDriverCaps; /** * /** */ export type RcMode = typeof RC_MODE_JS | typeof RC_MODE_REMOTE; /** * Possible values of the `rcMode` cap */ export type TizenTVDriverExecuteMethodMap = typeof TizenTVDriver.executeMethodMap; /** * Options for {@linkcode TizenTVDriver.startChromedriver} */ export type StartChromedriverOptions = { executable: string | undefined; executableDir: string | undefined; isAutodownloadEnabled: boolean; verbose: boolean | undefined; debuggerPort: number; }; export type DriverOpts = import("@appium/types").DriverOpts; /** * Like {@linkcode TizenTVDriverCaps} but the actually-required stuff is required. */ export type StrictTizenTVDriverCaps = import("type-fest").SetRequired; export type TizenTVDriverCapConstraints = import("./desired-caps").TizenTVDriverCapConstraints; export type RcKeyCode = import("@headspinio/tizen-remote").RcKeyCode; export type DriverData = import("@appium/types").DriverData; export type ServerArgs = import("@appium/types").ServerArgs; export type ExecuteMethodArgs = readonly any[] | readonly [import("@appium/types").StringRecord] | Readonly; /** * @extends {BaseDriver} */ export class TizenTVDriver extends BaseDriver<{ readonly platformName: { readonly isString: true; readonly inclusionCaseInsensitive: readonly ["TizenTV"]; readonly presence: true; }; readonly deviceName: { readonly isString: true; readonly presence: true; }; readonly deviceAddress: { readonly isString: true; }; readonly app: { readonly isString: true; }; readonly appPackage: { readonly isString: true; }; readonly udid: { readonly isString: true; }; readonly chromedriverExecutable: { readonly isString: true; }; readonly chromedriverExecutableDir: { readonly isString: true; }; readonly isDeviceApiSsl: { readonly isBoolean: true; }; readonly useOpenDebugPort: { readonly isNumber: true; }; readonly powerCyclePostUrl: { readonly isString: true; }; readonly rcToken: { readonly isString: true; }; readonly resetRcToken: { readonly isBoolean: true; }; readonly sendKeysStrategy: { readonly isString: true; }; readonly rcMode: { readonly isString: true; readonly inclusionCaseInsensitive: readonly ["remote", "js"]; }; readonly rcOnly: { readonly isBoolean: true; }; readonly rcDebugLog: { readonly isBoolean: true; }; readonly rcKeypressCooldown: { readonly isNumber: true; }; readonly appLaunchCooldown: { readonly isNumber: true; }; readonly showChromedriverLog: { readonly isBoolean: true; }; readonly sdbExecTimeout: { readonly isNumber: true; }; readonly sdbExecRetryCount: { readonly isNumber: true; }; }, import("@appium/types").StringRecord, import("@appium/types").StringRecord, import("@appium/types").DefaultCreateSessionResult<{ readonly platformName: { readonly isString: true; readonly inclusionCaseInsensitive: readonly ["TizenTV"]; readonly presence: true; }; readonly deviceName: { readonly isString: true; readonly presence: true; }; readonly deviceAddress: { readonly isString: true; }; readonly app: { readonly isString: true; }; readonly appPackage: { readonly isString: true; }; readonly udid: { readonly isString: true; }; readonly chromedriverExecutable: { readonly isString: true; }; readonly chromedriverExecutableDir: { readonly isString: true; }; readonly isDeviceApiSsl: { readonly isBoolean: true; }; readonly useOpenDebugPort: { readonly isNumber: true; }; readonly powerCyclePostUrl: { readonly isString: true; }; readonly rcToken: { readonly isString: true; }; readonly resetRcToken: { readonly isBoolean: true; }; readonly sendKeysStrategy: { readonly isString: true; }; readonly rcMode: { readonly isString: true; readonly inclusionCaseInsensitive: readonly ["remote", "js"]; }; readonly rcOnly: { readonly isBoolean: true; }; readonly rcDebugLog: { readonly isBoolean: true; }; readonly rcKeypressCooldown: { readonly isNumber: true; }; readonly appLaunchCooldown: { readonly isNumber: true; }; readonly showChromedriverLog: { readonly isBoolean: true; }; readonly sdbExecTimeout: { readonly isNumber: true; }; readonly sdbExecRetryCount: { readonly isNumber: true; }; }>, void, import("@appium/types").StringRecord> { static executeMethodMap: Readonly<{ 'tizen: pressKey': Readonly<{ command: "pressKey"; params: { required: string[]; }; }>; 'tizen: longPressKey': Readonly<{ command: "longPressKey"; params: { required: string[]; optional: string[]; }; }>; 'tizen: listApps': Readonly<{ command: "tizentvListApps"; params: {}; }>; 'tizen: activateApp': Readonly<{ command: "tizentvActivateApp"; params: { required: string[]; optional: string[]; }; }>; 'tizen: terminateApp': Readonly<{ command: "tizentvTerminateApp"; params: { required: string[]; }; }>; 'tizen: clearApp': Readonly<{ command: "tizentvClearApp"; params: {}; }>; }>; /** * * @param {any} value * @returns {value is keyof typeof TizenTVDriver.executeMethodMap} */ static isExecuteScript(value: any): value is keyof typeof TizenTVDriver.executeMethodMap; /** * * @param {DriverOpts} [opts] * @param {boolean} [shouldValidateCaps] */ constructor(opts?: DriverOpts, shouldValidateCaps?: boolean); /** * * @param {StrictTizenTVDriverCaps} caps * @param {string|undefined} debugAppPackage Use the given app pacakge prior than the caps's one * @returns {Promise} */ setupDebugger(caps: StrictTizenTVDriverCaps, debugAppPackage?: string | undefined): Promise; /** * @typedef BrowserVersionInfo * @property {string} Browser * @property {string} Protocol-Version * @property {string} User-Agent * @property {string} WebKit-Version * @property {string} [V8-Version] * @property {string} [webSocketDebuggerUrl] */ /** * Set chrome version v58.0.3029.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; "WebKit-Version": string; "V8-Version"?: string | undefined; webSocketDebuggerUrl?: string | undefined; }): { Browser: string; "Protocol-Version": string; "User-Agent": string; "WebKit-Version": string; "V8-Version"?: string | undefined; webSocketDebuggerUrl?: string | undefined; }; /** * * @param {StartChromedriverOptions} opts */ startChromedriver({ debuggerPort, executable, executableDir, isAutodownloadEnabled, verbose }: StartChromedriverOptions): Promise; proxyReqRes: any; proxyCommand: any; /** * Given a script of {@linkcode ScriptId} or some arbitrary JS, figure out * which it is and run it. * @template {ExecuteMethodArgs} [TArgs=unknown[]] * @template [TReturn=unknown] * @param {string} script - Either a script to run, or in the case of an Execute Method, the name of the script to execute. * @param {TArgs} [args] * @returns {Promise} */ execute(script: string, args?: TArgs): Promise; /** * Execute some arbitrary JS via Chromedriver. * @template {readonly any[]} [TArgs=unknown[]] * @template [TReturn=unknown] * @param {((...args: any[]) => TReturn)|string} script * @param {TArgs} [args] * @returns {Promise<{value: TReturn}>} */ executeChromedriverScript(script: ((...args: any[]) => TReturn) | string, args?: TArgs): Promise<{ value: TReturn; }>; /** * Execute some arbitrary JS via Chromedriver. * @template [TReturn=unknown] * @template [TArg=any] * @param {((...args: any[]) => TReturn)|string} script * @param {TArg[]} [args] * @returns {Promise<{value: TReturn}>} */ executeChromedriverAsyncScript(script: ((...args: any[]) => TReturn) | string, args?: TArg[]): Promise<{ value: TReturn; }>; deleteSession(): Promise; /** * Cleanup any ports used by this driver instance. */ cleanUpPorts(): Promise; proxyActive(): boolean; getProxyAvoidList(): import("@appium/types").RouteMatcher[]; canProxy(): boolean; /** * Press a key on the remote control. * * Referenced in {@linkcode TizenTVDriver.executeMethodMap} * @param {RcKeyCode} rcKeyCode * @returns {Promise} */ pressKey(rcKeyCode: RcKeyCode): Promise; /** * "Long press" a key with an optional duration. * * Default duration is {@linkcode DEFAULT_LONG_KEYPRESS_DELAY}. * @param {RcKeyCode} key * @param {number} [duration] * @returns {Promise} */ longPressKey(key: RcKeyCode, duration?: number): Promise; /** * Sets the value of a text input box * @param {string|string[]} text - If an array, will be joined with an empty character * @param {string} elId - Element ID * @returns {Promise} */ setValue(text: string | string[], elId: string): Promise; /** * Return the list of installed applications with the pair of * an application name and the package name. * @returns {Promise<[{appName: string, appPackage: string}]|[]>} */ tizentvListApps(): Promise<[{ appName: string; appPackage: string; }] | []>; /** * Launch the given appPackage. The process won't start as a debug mode. * @param {string} appPackage * @param {boolean} [debug=false] If launch the appPackage with debug mode. * Then, running chromedriver session will stop. * @returns */ tizentvActivateApp(appPackage: string, debug?: boolean): Promise; /** * Terminate the given app package id. * @param {string} pkgId * @returns */ tizentvTerminateApp(pkgId: string): Promise; /** * Clear the local data of the application under test. */ tizentvClearApp(): Promise; /** * 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} */ getCurrentContext(): Promise; /** * Tiemout to run sdb or tizen command * @returns {number} */ get sdbExecTimeout(): number; /** * Tiemout to run sdb or tizen command * @returns {number} */ get sdbExecRetryCount(): number; #private; } import { Keys } from '@headspinio/tizen-remote'; import { BaseDriver } from 'appium/driver'; export { Keys }; //# sourceMappingURL=driver.d.ts.map