docs: change StorageState type to string in java and C# (#5268)

This commit is contained in:
Yury Semikhatsky 2021-02-02 17:48:32 -08:00 committed by GitHub
parent 1a464c732c
commit 4cd0d3e5da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 6 deletions

View file

@ -132,7 +132,11 @@ page.goto("https://example.com")
### option: Browser.newContext.proxy = %%-context-option-proxy-%% ### 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 ## async method: Browser.newPage
- returns: <[Page]> - 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.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 ## method: Browser.version
- returns: <[string]> - returns: <[string]>

View file

@ -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. 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 ### option: BrowserContext.storageState.path
- `path` <[path]> - `path` <[path]>

View file

@ -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`. 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]> - `storageState` <[path]|[Object]>
- `cookies` <[Array]<[Object]>> Optional cookies to set for context - `cookies` <[Array]<[Object]>> Optional cookies to set for context
- `name` <[string]> - `name` <[string]>
@ -161,9 +162,23 @@ Specify environment variables that will be visible to the browser. Defaults to `
- `name` <[string]> - `name` <[string]>
- `value` <[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: 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 ## context-option-acceptdownloads
- `acceptDownloads` <[boolean]> - `acceptDownloads` <[boolean]>

4
types/types.d.ts vendored
View file

@ -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 * obtained via
* [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browsercontextstoragestateoptions). * [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: * 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 * obtained via
* [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browsercontextstoragestateoptions). * [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: * Either a path to the file with saved storage, or an object with the following fields: