docs: fix docs for toHaveScreenshot (#14280)
This commit is contained in:
parent
3e084829c0
commit
3fd435d1d3
|
|
@ -1005,11 +1005,8 @@ Property value.
|
|||
## async method: LocatorAssertions.toHaveScreenshot#1
|
||||
* langs: js
|
||||
|
||||
Ensures that [Locator] resolves to a given screenshot. This function will re-take
|
||||
screenshots until it matches with the saved expectation.
|
||||
|
||||
If there's no expectation yet, it will wait until two consecutive screenshots
|
||||
yield the same result, and save the last one as an expectation.
|
||||
This function will wait until two consecutive locator screenshots
|
||||
yield the same result, and then compare the last screenshot with the expectation.
|
||||
|
||||
```js
|
||||
const locator = page.locator('button');
|
||||
|
|
@ -1035,11 +1032,8 @@ Snapshot name.
|
|||
## async method: LocatorAssertions.toHaveScreenshot#2
|
||||
* langs: js
|
||||
|
||||
Ensures that [Locator] resolves to a given screenshot. This function will re-take
|
||||
screenshots until it matches with the saved expectation.
|
||||
|
||||
If there's no expectation yet, it will wait until two consecutive screenshots
|
||||
yield the same result, and save the last one as an expectation.
|
||||
This function will wait until two consecutive locator screenshots
|
||||
yield the same result, and then compare the last screenshot with the expectation.
|
||||
|
||||
```js
|
||||
const locator = page.locator('button');
|
||||
|
|
|
|||
|
|
@ -117,11 +117,8 @@ Expected substring or RegExp.
|
|||
## async method: PageAssertions.toHaveScreenshot#1
|
||||
* langs: js
|
||||
|
||||
Ensures that the page resolves to a given screenshot. This function will re-take
|
||||
screenshots until it matches with the saved expectation.
|
||||
|
||||
If there's no expectation yet, it will wait until two consecutive screenshots
|
||||
yield the same result, and save the last one as an expectation.
|
||||
This function will wait until two consecutive page screenshots
|
||||
yield the same result, and then compare the last screenshot with the expectation.
|
||||
|
||||
```js
|
||||
await expect(page).toHaveScreenshot('image.png');
|
||||
|
|
@ -148,11 +145,8 @@ Snapshot name.
|
|||
## async method: PageAssertions.toHaveScreenshot#2
|
||||
* langs: js
|
||||
|
||||
Ensures that the page resolves to a given screenshot. This function will re-take
|
||||
screenshots until it matches with the saved expectation.
|
||||
|
||||
If there's no expectation yet, it will wait until two consecutive screenshots
|
||||
yield the same result, and save the last one as an expectation.
|
||||
This function will wait until two consecutive page screenshots
|
||||
yield the same result, and then compare the last screenshot with the expectation.
|
||||
|
||||
```js
|
||||
await expect(page).toHaveScreenshot();
|
||||
|
|
|
|||
28
packages/playwright-test/types/test.d.ts
vendored
28
packages/playwright-test/types/test.d.ts
vendored
|
|
@ -3328,11 +3328,8 @@ interface LocatorAssertions {
|
|||
}): Promise<void>;
|
||||
|
||||
/**
|
||||
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* const locator = page.locator('button');
|
||||
|
|
@ -3406,11 +3403,8 @@ interface LocatorAssertions {
|
|||
}): Promise<void>;
|
||||
|
||||
/**
|
||||
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* const locator = page.locator('button');
|
||||
|
|
@ -3562,11 +3556,8 @@ interface PageAssertions {
|
|||
not: PageAssertions;
|
||||
|
||||
/**
|
||||
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive page screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* await expect(page).toHaveScreenshot('image.png');
|
||||
|
|
@ -3670,11 +3661,8 @@ interface PageAssertions {
|
|||
}): Promise<void>;
|
||||
|
||||
/**
|
||||
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive page screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* await expect(page).toHaveScreenshot();
|
||||
|
|
|
|||
28
tests/config/experimental.d.ts
vendored
28
tests/config/experimental.d.ts
vendored
|
|
@ -19540,11 +19540,8 @@ interface LocatorAssertions {
|
|||
}): Promise<void>;
|
||||
|
||||
/**
|
||||
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* const locator = page.locator('button');
|
||||
|
|
@ -19618,11 +19615,8 @@ interface LocatorAssertions {
|
|||
}): Promise<void>;
|
||||
|
||||
/**
|
||||
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* const locator = page.locator('button');
|
||||
|
|
@ -19774,11 +19768,8 @@ interface PageAssertions {
|
|||
not: PageAssertions;
|
||||
|
||||
/**
|
||||
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive page screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* await expect(page).toHaveScreenshot('image.png');
|
||||
|
|
@ -19882,11 +19873,8 @@ interface PageAssertions {
|
|||
}): Promise<void>;
|
||||
|
||||
/**
|
||||
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the
|
||||
* saved expectation.
|
||||
*
|
||||
* If there's no expectation yet, it will wait until two consecutive screenshots yield the same result, and save the last
|
||||
* one as an expectation.
|
||||
* This function will wait until two consecutive page screenshots yield the same result, and then compare the last
|
||||
* screenshot with the expectation.
|
||||
*
|
||||
* ```js
|
||||
* await expect(page).toHaveScreenshot();
|
||||
|
|
|
|||
Loading…
Reference in a new issue