docs: fix docs for toHaveScreenshot (#14280)

This commit is contained in:
Andrey Lushnikov 2022-05-24 11:54:32 -06:00 committed by GitHub
parent 3e084829c0
commit 3fd435d1d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 60 deletions

View file

@ -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');

View file

@ -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();

View file

@ -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();

View file

@ -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();