Skip to content

Commit

Permalink
feat(roll): roll to ToT Playwright (08-11-24) (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
playwrightmachine authored Nov 8, 2024
1 parent a0fa9d9 commit 7a2a818
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 51 deletions.
20 changes: 10 additions & 10 deletions dotnet/docs/api/class-tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ await context.Tracing.StopAsync(new()

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.49</font><x-search>tracing.GroupAsync</x-search>

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();
Expand All @@ -57,20 +58,19 @@ await Page.Context().Tracing.GroupEndAsync();
**Arguments**
- `name` [string]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-name"/><a href="#tracing-group-option-name" class="list-anchor">#</a>

Group name shown in the actions tree in trace viewer.
Group name shown in the trace viewer.
- `options` `TracingGroupOptions?` *(optional)*
- `Location` Location? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-location"/><a href="#tracing-group-option-location" class="list-anchor">#</a>
- `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]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-return"/><a href="#tracing-group-return" class="list-anchor">#</a>
Expand Down
20 changes: 10 additions & 10 deletions java/docs/api/class-tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ context.tracing().stop(new Tracing.StopOptions()

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.49</font><x-search>tracing.group</x-search>

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();
Expand All @@ -52,20 +53,19 @@ page.context().tracing.groupEnd();
**Arguments**
- `name` [String]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-name"/><a href="#tracing-group-option-name" class="list-anchor">#</a>

Group name shown in the actions tree in trace viewer.
Group name shown in the trace viewer.
- `options` `Tracing.GroupOptions` *(optional)*
- `setLocation` Location *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-location"/><a href="#tracing-group-option-location" class="list-anchor">#</a>
- `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]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-return"/><a href="#tracing-group-return" class="list-anchor">#</a>
Expand Down
32 changes: 12 additions & 20 deletions nodejs/docs/api/class-tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,46 +29,38 @@ await context.tracing.stop({ path: 'trace.zip' });

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.49</font><x-search>tracing.group</x-search>

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]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-name"/><a href="#tracing-group-option-name" class="list-anchor">#</a>

Group name shown in the actions tree in trace viewer.
Group name shown in the trace viewer.
- `options` [Object] *(optional)*
- `location` [Object] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-location"/><a href="#tracing-group-option-location" class="list-anchor">#</a>
- `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]&lt;[void]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-return"/><a href="#tracing-group-return" class="list-anchor">#</a>
Expand Down
23 changes: 12 additions & 11 deletions python/docs/api/class-tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ await context.tracing.stop(path = "trace.zip")

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.49</font><x-search>tracing.group</x-search>

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**

<Tabs
Expand All @@ -74,7 +74,8 @@ When using Playwright test runner, we strongly recommend `test.step` instead.
<TabItem value="sync">

```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()
Expand All @@ -85,7 +86,8 @@ page.context.tracing.group_end()
<TabItem value="async">

```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()
Expand All @@ -98,19 +100,18 @@ await page.context.tracing.group_end()
**Arguments**
- `name` [str]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-name"/><a href="#tracing-group-option-name" class="list-anchor">#</a>

Group name shown in the actions tree in trace viewer.
Group name shown in the trace viewer.
- `location` [Dict] *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-option-location"/><a href="#tracing-group-option-location" class="list-anchor">#</a>
- `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]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="tracing-group-return"/><a href="#tracing-group-return" class="list-anchor">#</a>
Expand Down

0 comments on commit 7a2a818

Please sign in to comment.