docs: fix docs for toHaveScreenshot (#14280)

This commit is contained in:
Andrey Lushnikov 2022-05-24 11:54:32 -06:00 committed by Ross A. Wollman
parent 38fe4a5102
commit 5965143b73
4 changed files with 24 additions and 60 deletions

View file

@ -1005,11 +1005,8 @@ Property value.
## async method: LocatorAssertions.toHaveScreenshot#1 ## async method: LocatorAssertions.toHaveScreenshot#1
* langs: js * langs: js
Ensures that [Locator] resolves to a given screenshot. This function will re-take This function will wait until two consecutive locator screenshots
screenshots until it matches with the saved expectation. yield the same result, and then compare the last screenshot with the 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.
```js ```js
const locator = page.locator('button'); const locator = page.locator('button');
@ -1035,11 +1032,8 @@ Snapshot name.
## async method: LocatorAssertions.toHaveScreenshot#2 ## async method: LocatorAssertions.toHaveScreenshot#2
* langs: js * langs: js
Ensures that [Locator] resolves to a given screenshot. This function will re-take This function will wait until two consecutive locator screenshots
screenshots until it matches with the saved expectation. yield the same result, and then compare the last screenshot with the 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.
```js ```js
const locator = page.locator('button'); const locator = page.locator('button');

View file

@ -117,11 +117,8 @@ Expected substring or RegExp.
## async method: PageAssertions.toHaveScreenshot#1 ## async method: PageAssertions.toHaveScreenshot#1
* langs: js * langs: js
Ensures that the page resolves to a given screenshot. This function will re-take This function will wait until two consecutive page screenshots
screenshots until it matches with the saved expectation. yield the same result, and then compare the last screenshot with the 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.
```js ```js
await expect(page).toHaveScreenshot('image.png'); await expect(page).toHaveScreenshot('image.png');
@ -148,11 +145,8 @@ Snapshot name.
## async method: PageAssertions.toHaveScreenshot#2 ## async method: PageAssertions.toHaveScreenshot#2
* langs: js * langs: js
Ensures that the page resolves to a given screenshot. This function will re-take This function will wait until two consecutive page screenshots
screenshots until it matches with the saved expectation. yield the same result, and then compare the last screenshot with the 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.
```js ```js
await expect(page).toHaveScreenshot(); await expect(page).toHaveScreenshot();

View file

@ -3328,11 +3328,8 @@ interface LocatorAssertions {
}): Promise<void>; }): Promise<void>;
/** /**
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* const locator = page.locator('button'); * const locator = page.locator('button');
@ -3406,11 +3403,8 @@ interface LocatorAssertions {
}): Promise<void>; }): Promise<void>;
/** /**
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* const locator = page.locator('button'); * const locator = page.locator('button');
@ -3562,11 +3556,8 @@ interface PageAssertions {
not: PageAssertions; not: PageAssertions;
/** /**
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive page screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* await expect(page).toHaveScreenshot('image.png'); * await expect(page).toHaveScreenshot('image.png');
@ -3670,11 +3661,8 @@ interface PageAssertions {
}): Promise<void>; }): Promise<void>;
/** /**
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive page screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* await expect(page).toHaveScreenshot(); * await expect(page).toHaveScreenshot();

View file

@ -19540,11 +19540,8 @@ interface LocatorAssertions {
}): Promise<void>; }): Promise<void>;
/** /**
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* const locator = page.locator('button'); * const locator = page.locator('button');
@ -19618,11 +19615,8 @@ interface LocatorAssertions {
}): Promise<void>; }): Promise<void>;
/** /**
* Ensures that [Locator] resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive locator screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* const locator = page.locator('button'); * const locator = page.locator('button');
@ -19774,11 +19768,8 @@ interface PageAssertions {
not: PageAssertions; not: PageAssertions;
/** /**
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive page screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* await expect(page).toHaveScreenshot('image.png'); * await expect(page).toHaveScreenshot('image.png');
@ -19882,11 +19873,8 @@ interface PageAssertions {
}): Promise<void>; }): Promise<void>;
/** /**
* Ensures that the page resolves to a given screenshot. This function will re-take screenshots until it matches with the * This function will wait until two consecutive page screenshots yield the same result, and then compare the last
* saved expectation. * screenshot with the 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.
* *
* ```js * ```js
* await expect(page).toHaveScreenshot(); * await expect(page).toHaveScreenshot();