Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnet/docs/browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Certain Enterprise Browser Policies may impact Playwright's ability to launch an
:::

:::warning
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) fore details.
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for details.
:::

```xml
Expand Down
4 changes: 2 additions & 2 deletions java/docs/api/class-locatorassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,9 @@ assertThat(

---

### matchesAriaSnapshot() {#locator-assertions-to-match-aria-snapshot-1}
### matchesAriaSnapshot(options) {#locator-assertions-to-match-aria-snapshot-1}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.50</font><x-search>locatorAssertions.matchesAriaSnapshot()</x-search>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.50</font><x-search>locatorAssertions.matchesAriaSnapshot(options)</x-search>

Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.mdx).

Expand Down
2 changes: 1 addition & 1 deletion java/docs/browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Certain Enterprise Browser Policies may impact Playwright's ability to launch an
:::

:::warning
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) fore details.
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for details.
:::

```java
Expand Down
8 changes: 4 additions & 4 deletions nodejs/docs/api/class-locatorassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@ Note that screenshot assertions only work with Playwright test runner.

---

### toHaveScreenshot() {#locator-assertions-to-have-screenshot-2}
### toHaveScreenshot(options) {#locator-assertions-to-have-screenshot-2}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.23</font><x-search>locatorAssertions.toHaveScreenshot()</x-search>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.23</font><x-search>locatorAssertions.toHaveScreenshot(options)</x-search>

This function will wait until two consecutive locator screenshots yield the same result, and then compare the last screenshot with the expectation.

Expand Down Expand Up @@ -963,9 +963,9 @@ await expect(locator).toHaveValues([/R/, /G/]);

---

### toMatchAriaSnapshot() {#locator-assertions-to-match-aria-snapshot-1}
### toMatchAriaSnapshot(options) {#locator-assertions-to-match-aria-snapshot-1}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.50</font><x-search>locatorAssertions.toMatchAriaSnapshot()</x-search>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.50</font><x-search>locatorAssertions.toMatchAriaSnapshot(options)</x-search>

Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.mdx).

Expand Down
4 changes: 2 additions & 2 deletions nodejs/docs/api/class-pageassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ Note that screenshot assertions only work with Playwright test runner.

---

### toHaveScreenshot() {#page-assertions-to-have-screenshot-2}
### toHaveScreenshot(options) {#page-assertions-to-have-screenshot-2}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.23</font><x-search>pageAssertions.toHaveScreenshot()</x-search>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.23</font><x-search>pageAssertions.toHaveScreenshot(options)</x-search>

This function will wait until two consecutive page screenshots yield the same result, and then compare the last screenshot with the expectation.

Expand Down
4 changes: 2 additions & 2 deletions nodejs/docs/api/class-snapshotassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Note that matching snapshots only work with Playwright test runner.

---

### toMatchSnapshot() {#snapshot-assertions-to-match-snapshot-2}
### toMatchSnapshot(options) {#snapshot-assertions-to-match-snapshot-2}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.22</font><x-search>snapshotAssertions.toMatchSnapshot()</x-search>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.22</font><x-search>snapshotAssertions.toMatchSnapshot(options)</x-search>

:::caution

Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Certain Enterprise Browser Policies may impact Playwright's ability to launch an
:::

:::warning
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) fore details.
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for details.
:::

```js
Expand Down
4 changes: 2 additions & 2 deletions python/docs/api/class-locatorassertions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2124,9 +2124,9 @@ await expect(locator).to_have_values([re.compile(r"R"), re.compile(r"G")])

---

### to_match_aria_snapshot() {#locator-assertions-to-match-aria-snapshot-1}
### to_match_aria_snapshot(**kwargs) {#locator-assertions-to-match-aria-snapshot-1}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.50</font><x-search>locatorAssertions.to_match_aria_snapshot()</x-search>
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.50</font><x-search>locatorAssertions.to_match_aria_snapshot(**kwargs)</x-search>

Asserts that the target element matches the given [accessibility snapshot](../aria-snapshots.mdx).

Expand Down
2 changes: 1 addition & 1 deletion python/docs/browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Certain Enterprise Browser Policies may impact Playwright's ability to launch an
:::

:::warning
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) fore details.
Google Chrome and Microsoft Edge have switched to a [new headless mode](https://developer.chrome.com/docs/chromium/headless) implementation that is closer to a regular headed mode. This differs from [chromium headless shell](https://developer.chrome.com/blog/chrome-headless-shell) that is used in Playwright by default when running headless, so expect different behavior in some cases. See [issue #33566](https://github.com/microsoft/playwright/issues/33566) for details.
:::

```bash
Expand Down
9 changes: 7 additions & 2 deletions src/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,13 @@ import HTMLCard from '@site/src/components/HTMLCard';
for (const { name: memberName, usages, args, signatures } of this.formatter.formatMember(member)) {
let name = memberName;
// Use test. prefix for test.* members for readability.
if (membersWithOverloads.has(name) && signatures)
name = `${name}(${signatures[0]})`;
if (membersWithOverloads.has(name) && signatures) {
// Pick first non-empty signature if any that way following will stand:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I help?

// - toMatchAriaSnapshot(expected) signatures=['expected', 'expected, options']
// - toMatchAriaSnapshot(options) signatures=['options']
const signature = signatures.find(s => !!s.trim()) || '';
name = `${name}(${signature})`;
}
if (clazz.varName === 'test')
name = `test.${name}`;

Expand Down
Loading