webdriverio
Version:
Next-gen browser and mobile automation test framework for Node.js
29 lines • 1.26 kB
TypeScript
/**
* Last override this session applied, keyed by browsing context, and which
* restore function is still the latest for a scope in that context.
*
* Device emulation reads this when a later command is rejected, so it can put
* back the previous override instead of clearing to a default. An older
* `restore()` for the same scope and context becomes a no-op once a newer
* call has replaced it.
*/
export interface RememberedViewport {
width: number;
height: number;
devicePixelRatio: number;
}
export interface RememberedOverrides {
userAgent?: string | null;
touch?: number | null;
textLayout?: 'mobile' | null;
viewportMeta?: true | null;
viewport?: RememberedViewport | null;
}
export declare function rememberOverride(browser: WebdriverIO.Browser, context: string, patch: RememberedOverrides): void;
export declare function rememberedOverride(browser: WebdriverIO.Browser, context: string): RememberedOverrides;
/**
* Mark `token` as the restore that owns `scope` for these contexts.
* The returned function is true only for that latest call.
*/
export declare function claimRestore(browser: WebdriverIO.Browser, scope: string, contexts: string[]): () => boolean;
//# sourceMappingURL=emulationState.d.ts.map