docs: clarify tracing name parameter semantics (#28759)

Fixes https://github.com/microsoft/playwright/issues/28751
This commit is contained in:
Yury Semikhatsky 2023-12-21 15:24:54 -08:00 committed by GitHub
parent 5d9e08ac61
commit 207585ef63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 14 deletions

View File

@ -86,14 +86,14 @@ context.tracing().stop(new Tracing.StopOptions()
``` ```
```python async ```python async
await context.tracing.start(name="trace", screenshots=True, snapshots=True) await context.tracing.start(screenshots=True, snapshots=True)
page = await context.new_page() page = await context.new_page()
await page.goto("https://playwright.dev") await page.goto("https://playwright.dev")
await context.tracing.stop(path = "trace.zip") await context.tracing.stop(path = "trace.zip")
``` ```
```python sync ```python sync
context.tracing.start(name="trace", screenshots=True, snapshots=True) context.tracing.start(screenshots=True, snapshots=True)
page = context.new_page() page = context.new_page()
page.goto("https://playwright.dev") page.goto("https://playwright.dev")
context.tracing.stop(path = "trace.zip") context.tracing.stop(path = "trace.zip")
@ -120,8 +120,10 @@ await context.Tracing.StopAsync(new()
* since: v1.12 * since: v1.12
- `name` <[string]> - `name` <[string]>
If specified, the trace is going to be saved into the file with the If specified, intermediate trace files are going to be saved into the files with the
given name inside the [`option: tracesDir`] folder specified in [`method: BrowserType.launch`]. given name prefix inside the [`option: tracesDir`] folder specified in [`method: BrowserType.launch`].
To specify the final trace zip file name, you need to pass `path` option to
[`method: Tracing.stop`] instead.
### option: Tracing.start.screenshots ### option: Tracing.start.screenshots
* since: v1.12 * since: v1.12
@ -204,7 +206,7 @@ context.tracing().stopChunk(new Tracing.StopChunkOptions()
``` ```
```python async ```python async
await context.tracing.start(name="trace", screenshots=True, snapshots=True) await context.tracing.start(screenshots=True, snapshots=True)
page = await context.new_page() page = await context.new_page()
await page.goto("https://playwright.dev") await page.goto("https://playwright.dev")
@ -220,7 +222,7 @@ await context.tracing.stop_chunk(path = "trace2.zip")
``` ```
```python sync ```python sync
context.tracing.start(name="trace", screenshots=True, snapshots=True) context.tracing.start(screenshots=True, snapshots=True)
page = context.new_page() page = context.new_page()
page.goto("https://playwright.dev") page.goto("https://playwright.dev")
@ -274,8 +276,10 @@ Trace name to be shown in the Trace Viewer.
* since: v1.32 * since: v1.32
- `name` <[string]> - `name` <[string]>
If specified, the trace is going to be saved into the file with the If specified, intermediate trace files are going to be saved into the files with the
given name inside the [`option: tracesDir`] folder specified in [`method: BrowserType.launch`]. given name prefix inside the [`option: tracesDir`] folder specified in [`method: BrowserType.launch`].
To specify the final trace zip file name, you need to pass `path` option to
[`method: Tracing.stopChunk`] instead.
## async method: Tracing.stop ## async method: Tracing.stop
* since: v1.12 * since: v1.12

View File

@ -19211,9 +19211,11 @@ export interface Tracing {
*/ */
start(options?: { start(options?: {
/** /**
* If specified, the trace is going to be saved into the file with the given name inside the `tracesDir` folder * If specified, intermediate trace files are going to be saved into the files with the given name prefix inside the
* specified in * `tracesDir` folder specified in
* [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). To specify
* the final trace zip file name, you need to pass `path` option to
* [tracing.stop([options])](https://playwright.dev/docs/api/class-tracing#tracing-stop) instead.
*/ */
name?: string; name?: string;
@ -19269,9 +19271,11 @@ export interface Tracing {
*/ */
startChunk(options?: { startChunk(options?: {
/** /**
* If specified, the trace is going to be saved into the file with the given name inside the `tracesDir` folder * If specified, intermediate trace files are going to be saved into the files with the given name prefix inside the
* specified in * `tracesDir` folder specified in
* [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). To specify
* the final trace zip file name, you need to pass `path` option to
* [tracing.stopChunk([options])](https://playwright.dev/docs/api/class-tracing#tracing-stop-chunk) instead.
*/ */
name?: string; name?: string;