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
254 changes: 0 additions & 254 deletions docs/src/api/class-by.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/src/api/class-frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -1002,19 +1002,6 @@ await locator.ClickAsync();
### param: Frame.frameLocator.selector = %%-find-selector-%%
* since: v1.17

## method: Frame.get
* since: v1.63
* langs: js
- returns: <[Locator]>

%%-template-locator-get-%%

### param: Frame.get.by
* since: v1.63
- `by` <[By]>

Page-free locator built with [`property: Playwright.by`].

## async method: Frame.getAttribute
* since: v1.8
* discouraged: Use locator-based [`method: Locator.getAttribute`] instead. Read more about [locators](../locators.md).
Expand Down
13 changes: 0 additions & 13 deletions docs/src/api/class-framelocator.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,6 @@ in that iframe.
### param: FrameLocator.frameLocator.selector = %%-find-selector-%%
* since: v1.17

## method: FrameLocator.get
* since: v1.63
* langs: js
- returns: <[Locator]>

%%-template-locator-get-%%

### param: FrameLocator.get.by
* since: v1.63
- `by` <[By]>

Page-free locator built with [`property: Playwright.by`].

## method: FrameLocator.getByAltText
* since: v1.27
- returns: <[Locator]>
Expand Down
13 changes: 0 additions & 13 deletions docs/src/api/class-locator.md
Original file line number Diff line number Diff line change
Expand Up @@ -1479,19 +1479,6 @@ await locator.ClickAsync();
### param: Locator.frameLocator.selector = %%-find-selector-%%
* since: v1.17

## method: Locator.get
* since: v1.63
* langs: js
- returns: <[Locator]>

%%-template-locator-get-%%

### param: Locator.get.by
* since: v1.63
- `by` <[By]>

Page-free locator built with [`property: Playwright.by`].

## async method: Locator.getAttribute
* since: v1.14
- returns: <[null]|[string]>
Expand Down
13 changes: 0 additions & 13 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2252,19 +2252,6 @@ await locator.ClickAsync();

An array of all frames attached to the page.

## method: Page.get
* since: v1.63
* langs: js
- returns: <[Locator]>

%%-template-locator-get-%%

### param: Page.get.by
* since: v1.63
- `by` <[By]>

Page-free locator built with [`property: Playwright.by`].

## async method: Page.getAttribute
* since: v1.8
* discouraged: Use locator-based [`method: Locator.getAttribute`] instead. Read more about [locators](../locators.md).
Expand Down
18 changes: 0 additions & 18 deletions docs/src/api/class-playwright.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,6 @@ class PlaywrightExample
}
```

## property: Playwright.by
* since: v1.63
* langs: js
- type: <[By]>

Builds page-free locators that are resolved with [`method: Page.get`], [`method: Frame.get`] or
[`method: Locator.get`]. See [By] for details.

```js
import { by, test } from '@playwright/test';

const saveButton = by.role('button', { name: 'Save' });

test('saves', async ({ page }) => {
await page.get(saveButton).click();
});
```

## property: Playwright.chromium
* since: v1.8
- type: <[BrowserType]>
Expand Down
32 changes: 0 additions & 32 deletions docs/src/api/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -1537,38 +1537,6 @@ Locator is resolved to the element immediately before performing an action, so a

[Learn more about locators](../locators.md).

## template-locator-get

Binds a page-free [By] locator, returning a [Locator] scoped to this object.

**Usage**

Consider a page object that describes elements without a page:

```js
// todo-page.ts
import { by } from '@playwright/test';

export const newTodo = by.placeholder('What needs to be done?');
export const todoItems = by.testId('todo-list').role('listitem');
```

```js
import { expect, test } from '@playwright/test';
import { newTodo, todoItems } from './todo-page';

test('adds a todo', async ({ page }) => {
await page.get(newTodo).fill('buy milk');
await expect(page.get(todoItems)).toHaveCount(1);
});
```

**Details**

The resolved [Locator] is the same one the equivalent `getBy*` chain would produce, so
`page.get(by.testId('list').text('Row'))` and `page.getByTestId('list').getByText('Row')` match the
same element.

## template-locator-get-by-test-id

Locate element by the test id.
Expand Down
Loading