From 4cd0d3e5dacea5ecac05b92292f87314f39060f9 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Tue, 2 Feb 2021 17:48:32 -0800 Subject: [PATCH] docs: change StorageState type to string in java and C# (#5268) --- docs/src/api/class-browser.md | 12 ++++++++++-- docs/src/api/class-browsercontext.md | 4 ++++ docs/src/api/params.md | 19 +++++++++++++++++-- types/types.d.ts | 4 ++-- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/src/api/class-browser.md b/docs/src/api/class-browser.md index d5f1ecad00..1a3128c62e 100644 --- a/docs/src/api/class-browser.md +++ b/docs/src/api/class-browser.md @@ -132,7 +132,11 @@ page.goto("https://example.com") ### option: Browser.newContext.proxy = %%-context-option-proxy-%% -### option: Browser.newContext.storageState = %%-context-option-storage-state-%% +### option: Browser.newContext.storageState = %%-js-python-context-option-storage-state-%% + +### option: Browser.newContext.storageState = %%-csharp-java-context-option-storage-state-%% + +### option: Browser.newContext.storageStatePath = %%-csharp-java-context-option-storage-state-path-%% ## async method: Browser.newPage - returns: <[Page]> @@ -147,7 +151,11 @@ testing frameworks should explicitly create [`method: Browser.newContext`] follo ### option: Browser.newPage.proxy = %%-context-option-proxy-%% -### option: Browser.newPage.storageState = %%-context-option-storage-state-%% +### option: Browser.newPage.storageState = %%-js-python-context-option-storage-state-%% + +### option: Browser.newPage.storageState = %%-csharp-java-context-option-storage-state-%% + +### option: Browser.newPage.storageStatePath = %%-csharp-java-context-option-storage-state-path-%% ## method: Browser.version - returns: <[string]> diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index 08787c7484..d2eaccc93b 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -712,6 +712,10 @@ Whether to emulate network being offline for the browser context. Returns storage state for this browser context, contains current cookies and local storage snapshot. +## async method: BrowserContext.storageState +* langs: charp, java +- returns: <[string]> + ### option: BrowserContext.storageState.path - `path` <[path]> diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 122dde970f..b32fa0a847 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -143,7 +143,8 @@ Specify environment variables that will be visible to the browser. Defaults to ` Specify environment variables that will be visible to the browser. Defaults to `process.env`. -## context-option-storage-state +## js-python-context-option-storage-state +* langs: js, python - `storageState` <[path]|[Object]> - `cookies` <[Array]<[Object]>> Optional cookies to set for context - `name` <[string]> @@ -161,9 +162,23 @@ Specify environment variables that will be visible to the browser. Defaults to ` - `name` <[string]> - `value` <[string]> -Populates context with given storage state. This method can be used to initialize context with logged-in information +Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]. Either a path to the file with saved storage, or an object with the following fields: +## csharp-java-context-option-storage-state +* langs: csharp, java +- `storageState` <[string]> + +Populates context with given storage state. This option can be used to initialize context with logged-in information +obtained via [`method: BrowserContext.storageState`]. + +## csharp-java-context-option-storage-state-path +* langs: csharp, java +- `storageStatePath` <[path]> + +Populates context with given storage state. This option can be used to initialize context with logged-in information +obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state. + ## context-option-acceptdownloads - `acceptDownloads` <[boolean]> diff --git a/types/types.d.ts b/types/types.d.ts index ac04bb6482..b8f143da4e 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -7431,7 +7431,7 @@ export interface Browser extends EventEmitter { }; /** - * Populates context with given storage state. This method can be used to initialize context with logged-in information + * Populates context with given storage state. This option can be used to initialize context with logged-in information * obtained via * [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browsercontextstoragestateoptions). * Either a path to the file with saved storage, or an object with the following fields: @@ -9506,7 +9506,7 @@ export interface BrowserContextOptions { }; /** - * Populates context with given storage state. This method can be used to initialize context with logged-in information + * Populates context with given storage state. This option can be used to initialize context with logged-in information * obtained via * [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browsercontextstoragestateoptions). * Either a path to the file with saved storage, or an object with the following fields: