mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-05 19:04:43 +03:00
docs: fix minor grammar and text issues (#24331)
This commit is contained in:
parent
2cb0622c39
commit
b93b2a7155
@ -2,7 +2,7 @@
|
||||
* since: v1.14
|
||||
|
||||
Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent
|
||||
a way to find element(s) on the page at any moment. Locator can be created with the [`method: Page.locator`] method.
|
||||
a way to find element(s) on the page at any moment. A locator can be created with the [`method: Page.locator`] method.
|
||||
|
||||
[Learn more about locators](../locators.md).
|
||||
|
||||
@ -10,8 +10,7 @@ a way to find element(s) on the page at any moment. Locator can be created with
|
||||
* since: v1.29
|
||||
- returns: <[Array]<[Locator]>>
|
||||
|
||||
When locator points to a list of elements, returns array of locators, pointing
|
||||
to respective elements.
|
||||
When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements.
|
||||
|
||||
:::note
|
||||
[`method: Locator.all`] does not wait for elements to match the locator, and instead immediately returns whatever is present in the page.
|
||||
|
@ -144,7 +144,7 @@ You can use the test generator to generate tests using emulation so as to genera
|
||||
|
||||
### Emulate viewport size
|
||||
|
||||
Playwright opens a browser window with it's viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.
|
||||
Playwright opens a browser window with its viewport set to a specific width and height and is not responsive as tests need to be run under the same conditions. Use the `--viewport` option to generate tests with a different viewport size.
|
||||
|
||||
```bash js
|
||||
npx playwright codegen --viewport-size=800,600 playwright.dev
|
||||
|
@ -200,7 +200,7 @@ For example, consider the following DOM structure.
|
||||
<button>Submit</button>
|
||||
```
|
||||
|
||||
You can locate each element by it's implicit role:
|
||||
You can locate each element by its implicit role:
|
||||
|
||||
```js
|
||||
await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();
|
||||
@ -519,7 +519,7 @@ For example, consider the following DOM structure.
|
||||
<button data-testid="directions">Itinéraire</button>
|
||||
```
|
||||
|
||||
You can locate the element by it's test id:
|
||||
You can locate the element by its test id:
|
||||
|
||||
```js
|
||||
await page.getByTestId('directions').click();
|
||||
@ -1220,7 +1220,7 @@ await newEmail.ClickAsync();
|
||||
It's usually better to find a [more reliable way](./locators.md#quick-guide) to uniquely identify the element instead of checking the visibility.
|
||||
:::
|
||||
|
||||
Consider a page with two buttons, first invisible and second [visible](./actionability.md#visible).
|
||||
Consider a page with two buttons, the first invisible and the second [visible](./actionability.md#visible).
|
||||
|
||||
```html
|
||||
<button style='display: none'>Invisible</button>
|
||||
@ -1352,7 +1352,7 @@ await Expect(page
|
||||
There are many ways to get a specific item in a list.
|
||||
#### Get by text
|
||||
|
||||
Use the [`method: Page.getByText`] method to locate an element in a list by it's text content and then click on it.
|
||||
Use the [`method: Page.getByText`] method to locate an element in a list by its text content and then click on it.
|
||||
|
||||
For example, consider the following DOM structure:
|
||||
|
||||
@ -1364,7 +1364,7 @@ For example, consider the following DOM structure:
|
||||
</ul>
|
||||
```
|
||||
|
||||
Locate an item by it's text content and click it.
|
||||
Locate an item by its text content and click it.
|
||||
|
||||
```js
|
||||
await page.getByText('orange').click();
|
||||
|
5
packages/playwright-core/types/types.d.ts
vendored
5
packages/playwright-core/types/types.d.ts
vendored
@ -10330,7 +10330,7 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
|
||||
|
||||
/**
|
||||
* Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a
|
||||
* way to find element(s) on the page at any moment. Locator can be created with the
|
||||
* way to find element(s) on the page at any moment. A locator can be created with the
|
||||
* [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator) method.
|
||||
*
|
||||
* [Learn more about locators](https://playwright.dev/docs/locators).
|
||||
@ -10446,7 +10446,8 @@ export interface Locator {
|
||||
timeout?: number;
|
||||
}): Promise<null|ElementHandle<SVGElement | HTMLElement>>;
|
||||
/**
|
||||
* When locator points to a list of elements, returns array of locators, pointing to respective elements.
|
||||
* When the locator points to a list of elements, this returns an array of locators, pointing to their respective
|
||||
* elements.
|
||||
*
|
||||
* **NOTE** [locator.all()](https://playwright.dev/docs/api/class-locator#locator-all) does not wait for elements to
|
||||
* match the locator, and instead immediately returns whatever is present in the page. When the list of elements
|
||||
|
Loading…
Reference in New Issue
Block a user