webdriverio
Version:
Next-gen browser and mobile automation test framework for Node.js
35 lines • 1.98 kB
TypeScript
import type { remote } from 'webdriver';
type CookieAttributes = {
domain?: string;
path?: string;
};
export interface WindowCookieScope {
browser: WebdriverIO.Browser;
/**
* the jar of the window: its user context. Firefox limits the BiDi "context" partition to the
* origin of the page, so a read or delete there misses the cookies of other hosts, and a cookie set
* there is not visible to a plain http page; Chrome resolves "context" to the user context
*/
partition: remote.StoragePartitionDescriptor;
userContext?: string;
url?: URL;
}
/**
* With `wdio:experimentalBiDiCommands`, and in every parallel test, the cookie commands follow
* WebDriver BiDi as Puppeteer does: they use the cookie jar of the window (or of the browsing
* context they are called on). Without it, they keep their earlier behavior.
*/
export declare function windowCookieScope(target: WebdriverIO.Browser | WebdriverIO.BrowsingContext): Promise<WindowCookieScope | undefined>;
/**
* The cookies that a page sees, as Puppeteer filters the BiDi jar (BiDi filters only match exact
* values): RFC 6265 domain-match and path-match. Browsers store a host-only cookie without a leading
* dot. An IP address only matches itself. A page with no host (`about:blank`, `data:`) has no cookies.
*/
export declare function cookieMatchesUrl(url?: URL): (cookie: CookieAttributes) => boolean;
/** the cookie filters of `deleteCookies`; an entry that is not a name or a filter object is an error */
export declare function toCookieFilters(filterArray: unknown[]): remote.StorageCookieFilter[];
/** WebDriver BiDi only accepts a lowercase sameSite; the cookie types also allow the Classic spelling */
export declare function toBidiCookieFilter(filter: remote.StorageCookieFilter): remote.StorageCookieFilter;
export declare function getCookiePartition(sourceOrigin: string): remote.StoragePartitionDescriptor;
export {};
//# sourceMappingURL=cookiePartition.d.ts.map