UNPKG

webdriverio

Version:

Next-gen browser and mobile automation test framework for Node.js

36 lines • 2.08 kB
/** * A browsing context is a value you hold. It has a context id and a pointer * back to the session. An element found in one keeps that object as `parent`. * Its `wdio.kind` brand tells it apart, see `@wdio/utils` `kind.ts`. */ export declare function isBrowsingContext(value: unknown): value is WebdriverIO.BrowsingContext; /** * The id BiDi commands should target. A held context wins over the session * pointer, including when the caller is an element found in that context. * The session pointer is only the fallback for `browser.*`. */ export declare function contextIdOf(scope: WebdriverIO.Browser | WebdriverIO.Element | WebdriverIO.BrowsingContext | WebdriverIO.MultiRemoteBrowser): Promise<string>; /** * `getCurrentContext()` is a string in a real session. Unit tests sometimes * stub it as `{ context }`. Either way the id we store on the object is a string. */ export declare function contextIdValue(value: unknown): string; /** * The browsing context this value belongs to, when it is one or was found in one. * `browser.$()` elements have the browser as `parent` and return undefined. */ export declare function heldBrowsingContext(scope: unknown): WebdriverIO.BrowsingContext | undefined; /** * Context id to use when the caller lives in a different navigable than the * session pointer. Classic element commands only see the pointer's document. */ export declare function foreignContextId(scope: WebdriverIO.Browser | WebdriverIO.Element | WebdriverIO.BrowsingContext): Promise<string | undefined>; export declare function assertTopLevel(context: WebdriverIO.BrowsingContext, command: string): void; /** * A frame belongs to one document of its parent. When that page navigates * away, the frame is gone. Firefox can keep the old document (and its * frames) in the back/forward cache, where scripts never settle, so check * that the frame is still in its top-level context's tree before using it. */ export declare function assertFrameAttached(frame: WebdriverIO.BrowsingContext): Promise<void>; //# sourceMappingURL=browsingContext.d.ts.map