From 7a2a818e73a26b499a8df461c7ce60b19f9957be Mon Sep 17 00:00:00 2001 From: Playwright Service <89237858+playwrightmachine@users.noreply.github.com> Date: Fri, 8 Nov 2024 02:18:51 -0800 Subject: [PATCH] feat(roll): roll to ToT Playwright (08-11-24) (#1587) --- dotnet/docs/api/class-tracing.mdx | 20 +++++++++---------- java/docs/api/class-tracing.mdx | 20 +++++++++---------- nodejs/docs/api/class-tracing.mdx | 32 ++++++++++++------------------- python/docs/api/class-tracing.mdx | 23 +++++++++++----------- 4 files changed, 44 insertions(+), 51 deletions(-) diff --git a/dotnet/docs/api/class-tracing.mdx b/dotnet/docs/api/class-tracing.mdx index cfe807a41af..fe4d0ae7aa0 100644 --- a/dotnet/docs/api/class-tracing.mdx +++ b/dotnet/docs/api/class-tracing.mdx @@ -37,17 +37,18 @@ await context.Tracing.StopAsync(new() Added in: v1.49tracing.GroupAsync -Creates a new group within the trace, assigning any subsequent API calls to this group, until [Tracing.GroupEndAsync()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer and test reports. - :::caution -When using Playwright test runner, we strongly recommend `test.step` instead. +Use `test.step` instead when available. ::: +Creates a new group within the trace, assigning any subsequent API calls to this group, until [Tracing.GroupEndAsync()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer. + **Usage** ```csharp -// All actions between group and groupEnd will be shown in the trace viewer as a group. +// All actions between GroupAsync and GroupEndAsync +// will be shown in the trace viewer as a group. await Page.Context().Tracing.GroupAsync("Open Playwright.dev > API"); await Page.GotoAsync("https://playwright.dev/"); await Page.GetByRole(AriaRole.Link, new() { Name = "API" }).ClickAsync(); @@ -57,20 +58,19 @@ await Page.Context().Tracing.GroupEndAsync(); **Arguments** - `name` [string]# - Group name shown in the actions tree in trace viewer. + Group name shown in the trace viewer. - `options` `TracingGroupOptions?` *(optional)* - `Location` Location? *(optional)*# - `File` [string] - Source file path to be shown in the trace viewer source tab. + - `Line` [int]? *(optional)* - Line number in the source file. + - `Column` [int]? *(optional)* - Column number in the source file. - - Specifies a custom location for the group start to be shown in source tab in trace viewer. By default, location of the [Tracing.GroupAsync()](/api/class-tracing.mdx#tracing-group) call is shown. + + Specifies a custom location for the group to be shown in the trace viewer. Defaults to the location of the [Tracing.GroupAsync()](/api/class-tracing.mdx#tracing-group) call. **Returns** - [void]# diff --git a/java/docs/api/class-tracing.mdx b/java/docs/api/class-tracing.mdx index 03a2f863453..4ff820dae49 100644 --- a/java/docs/api/class-tracing.mdx +++ b/java/docs/api/class-tracing.mdx @@ -32,17 +32,18 @@ context.tracing().stop(new Tracing.StopOptions() Added in: v1.49tracing.group -Creates a new group within the trace, assigning any subsequent API calls to this group, until [Tracing.groupEnd()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer and test reports. - :::caution -When using Playwright test runner, we strongly recommend `test.step` instead. +Use `test.step` instead when available. ::: +Creates a new group within the trace, assigning any subsequent API calls to this group, until [Tracing.groupEnd()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer. + **Usage** ```java -// All actions between group and groupEnd will be shown in the trace viewer as a group. +// All actions between group and groupEnd +// will be shown in the trace viewer as a group. page.context().tracing.group("Open Playwright.dev > API"); page.navigate("https://playwright.dev/"); page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("API")).click(); @@ -52,20 +53,19 @@ page.context().tracing.groupEnd(); **Arguments** - `name` [String]# - Group name shown in the actions tree in trace viewer. + Group name shown in the trace viewer. - `options` `Tracing.GroupOptions` *(optional)* - `setLocation` Location *(optional)*# - `setFile` [String] - Source file path to be shown in the trace viewer source tab. + - `setLine` [int] *(optional)* - Line number in the source file. + - `setColumn` [int] *(optional)* - Column number in the source file. - - Specifies a custom location for the group start to be shown in source tab in trace viewer. By default, location of the [Tracing.group()](/api/class-tracing.mdx#tracing-group) call is shown. + + Specifies a custom location for the group to be shown in the trace viewer. Defaults to the location of the [Tracing.group()](/api/class-tracing.mdx#tracing-group) call. **Returns** - [void]# diff --git a/nodejs/docs/api/class-tracing.mdx b/nodejs/docs/api/class-tracing.mdx index 890fe8128f8..9ebe520714c 100644 --- a/nodejs/docs/api/class-tracing.mdx +++ b/nodejs/docs/api/class-tracing.mdx @@ -29,46 +29,38 @@ await context.tracing.stop({ path: 'trace.zip' }); Added in: v1.49tracing.group -Creates a new group within the trace, assigning any subsequent API calls to this group, until [tracing.groupEnd()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer and test reports. - :::caution -When using Playwright test runner, we strongly recommend `test.step` instead. +Use `test.step` instead when available. ::: +Creates a new group within the trace, assigning any subsequent API calls to this group, until [tracing.groupEnd()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer. + **Usage** ```js -await context.tracing.start({ screenshots: true, snapshots: true }); -await context.tracing.group('Open Playwright.dev'); -// All actions between group and groupEnd will be shown in the trace viewer as a group. -const page = await context.newPage(); -await page.goto('https://playwright.dev/'); -await context.tracing.groupEnd(); -await context.tracing.group('Open API Docs of Tracing'); -await page.getByRole('link', { name: 'API' }).click(); -await page.getByRole('link', { name: 'Tracing' }).click(); -await context.tracing.groupEnd(); -// This Trace will have two groups: 'Open Playwright.dev' and 'Open API Docs of Tracing'. +// use test.step instead +await test.step('Log in', async () => { + // ... +}); ``` **Arguments** - `name` [string]# - Group name shown in the actions tree in trace viewer. + Group name shown in the trace viewer. - `options` [Object] *(optional)* - `location` [Object] *(optional)*# - `file` [string] - Source file path to be shown in the trace viewer source tab. + - `line` [number] *(optional)* - Line number in the source file. + - `column` [number] *(optional)* - Column number in the source file. - - Specifies a custom location for the group start to be shown in source tab in trace viewer. By default, location of the [tracing.group()](/api/class-tracing.mdx#tracing-group) call is shown. + + Specifies a custom location for the group to be shown in the trace viewer. Defaults to the location of the [tracing.group()](/api/class-tracing.mdx#tracing-group) call. **Returns** - [Promise]<[void]># diff --git a/python/docs/api/class-tracing.mdx b/python/docs/api/class-tracing.mdx index 37410ce4b6b..22cdaa9cbf8 100644 --- a/python/docs/api/class-tracing.mdx +++ b/python/docs/api/class-tracing.mdx @@ -54,13 +54,13 @@ await context.tracing.stop(path = "trace.zip") Added in: v1.49tracing.group -Creates a new group within the trace, assigning any subsequent API calls to this group, until [tracing.group_end()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer and test reports. - :::caution -When using Playwright test runner, we strongly recommend `test.step` instead. +Use `test.step` instead when available. ::: +Creates a new group within the trace, assigning any subsequent API calls to this group, until [tracing.group_end()](/api/class-tracing.mdx#tracing-group-end) is called. Groups can be nested and will be visible in the trace viewer. + **Usage** ```py -# All actions between group and groupEnd will be shown in the trace viewer as a group. +# All actions between group and group_end +# will be shown in the trace viewer as a group. page.context.tracing.group("Open Playwright.dev > API") page.goto("https://playwright.dev/") page.get_by_role("link", name="API").click() @@ -85,7 +86,8 @@ page.context.tracing.group_end() ```py -# All actions between group and groupEnd will be shown in the trace viewer as a group. +# All actions between group and group_end +# will be shown in the trace viewer as a group. await page.context.tracing.group("Open Playwright.dev > API") await page.goto("https://playwright.dev/") await page.get_by_role("link", name="API").click() @@ -98,19 +100,18 @@ await page.context.tracing.group_end() **Arguments** - `name` [str]# - Group name shown in the actions tree in trace viewer. + Group name shown in the trace viewer. - `location` [Dict] *(optional)*# - `file` [str] - Source file path to be shown in the trace viewer source tab. + - `line` [int] *(optional)* - Line number in the source file. + - `column` [int] *(optional)* - Column number in the source file. - - Specifies a custom location for the group start to be shown in source tab in trace viewer. By default, location of the [tracing.group()](/api/class-tracing.mdx#tracing-group) call is shown. + + Specifies a custom location for the group to be shown in the trace viewer. Defaults to the location of the [tracing.group()](/api/class-tracing.mdx#tracing-group) call. **Returns** - [NoneType]#