Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: migration typos #17247

Merged
merged 2 commits into from
Sep 12, 2022
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
2 changes: 1 addition & 1 deletion docs/src/api/class-framelocator.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ await locator.ClickAsync();

**Strictness**

Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches given selector.
Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches a given selector.

```js
// Throws if there are several frames in DOM:
Expand Down
5 changes: 2 additions & 3 deletions docs/src/mock-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: "Mock APIs"

Playwright provides native support for most of the browser features. However, there are some experimental APIs
and APIs which are not (yet) fully supported by all browsers. Playwright usually doesn't provide dedicated
automation APIs in such cases. You can use mocks to test behavior of your application in such cases. This guide
automation APIs in such cases. You can use mocks to test the behavior of your application in such cases. This guide
gives a few examples.

<!-- TOC -->
Expand All @@ -18,8 +18,7 @@ battery status.

## Creating mocks

Since the page may be calling the API very early while loading it's important to setup all the mocks before the
page started loading. The easiest way to achieve that is to call [`method: Page.addInitScript`]:
Since the page may be calling the API very early while loading it's important to setup all the mocks before the page started loading. The easiest way to achieve that is to call [`method: Page.addInitScript`]:

```js
await page.addInitScript(() => {
Expand Down
6 changes: 3 additions & 3 deletions docs/src/protractor-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ Here's how to polyfill `waitForAngular` function in Playwright Test:
await page.goto('https://example.org');
await waitForAngular(page);
```

## Playwright Test Super Powers

Once you're on Playwright Test, you get a lot!

- Full zero-configuration TypeScript support
- Run tests across **all web engines** (Chrome, Firefox, Safari) on **any popular operating system** (Windows, MacOS, Ubuntu)
- Run tests across **all web engines** (Chrome, Firefox, Safari) on **any popular operating system** (Windows, macOS, Ubuntu)
- Full support for multiple origins, [(i)frames](./api/class-frame), [tabs and contexts](./pages)
- Run tests in parallel across multiple browsers
- Built-in test artifact collection: [video recording](./test-configuration#record-video), [screenshots](./test-configuration#automatic-screenshots) and [playwright traces](./test-configuration#record-test-trace)

Also you get all these ✨ awesome tools ✨ that come bundled with Playwright Test:
You also get all these ✨ awesome tools ✨ that come bundled with Playwright Test:
- [Playwright Inspector](./debug.md)
- [Playwright Test Code generation](./auth#code-generation)
- [Playwright Tracing](./trace-viewer) for post-mortem debugging
Expand Down
10 changes: 5 additions & 5 deletions docs/src/puppeteer-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ This guide describes migration to [Playwright Library](./library) and [Playwrigh

`page.waitForNavigation` and `page.waitForSelector` remain, but in many cases will not be necessary due to [auto-waiting](./actionability).

The use of [ElementHandle] is discouraged , use [Locator] objects and web-first assertions instead.
The use of [ElementHandle] is discouraged, use [Locator] objects and web-first assertions instead.

Locators are the central piece of Playwright's auto-waiting and retry-ability. Locators are strict. This means that all operations on locators that imply some target DOM element will throw an exception if more than one element matches given selector.
Locators are the central piece of Playwright's auto-waiting and retry-ability. Locators are strict. This means that all operations on locators that imply some target DOM element will throw an exception if more than one element matches a given selector.

## Examples

Expand Down Expand Up @@ -90,7 +90,7 @@ Migration highlights (see inline comments in the Playwright code snippet):
1. Each Playwright Library file has explicit import of `chromium`. Other browsers `webkit` or `firefox` can be used.
1. For browser state isolation, consider [browser contexts](./browser-contexts.md)
1. `setViewport` becomes `setViewportSize`
1. `networkidle2` becomes `networkidle`. Please note that on most cases it is not useful, thanks to auto-waiting.
1. `networkidle2` becomes `networkidle`. Please note that in most cases it is not useful, thanks to auto-waiting.

### Test example

Expand Down Expand Up @@ -145,7 +145,7 @@ Playwright Test creates an isolated [Page] object for each test. However, if you

With a few lines of code, you can hook up Playwright to your existing JavaScript [test runner](./test-runners).

To improve testing, it is adviced to use [Locators](./api/class-locator) and web-first [Assertions](./test-assertions). See [Writing Tests](./writing-tests)
To improve testing, it is advised to use [Locators](./api/class-locator) and web-first [Assertions](./test-assertions). See [Writing Tests](./writing-tests)

It is common with Puppeteer to use `page.evaluate()` or `page.$eval()` to inspect an [ElementHandle] and extract the value of text content, attribute, class... Web-first [Assertions](./test-assertions) offers several matchers for this purpose, it is more reliable and readable.

Expand All @@ -161,7 +161,7 @@ Once you're on Playwright Test, you get a lot!
- Run tests in isolation in parallel across multiple browsers
- Built-in test artifact collection: [video recording](./test-configuration#record-video), [screenshots](./test-configuration#automatic-screenshots) and [playwright traces](./test-configuration#record-test-trace)

Also you get all these ✨ awesome tools ✨ that come bundled with Playwright Test:
You also get all these ✨ awesome tools ✨ that come bundled with Playwright Test:
- [Playwright Inspector](./debug.md)
- [Playwright Test Code generation](./auth#code-generation)
- [Playwright Tracing](./trace-viewer) for post-mortem debugging
Expand Down
4 changes: 2 additions & 2 deletions docs/src/testing-library-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Migration highlights (see inline comments in the Playwright Test code snippet):

## Migrating queries

All queries like `getBy...`, `findBy...`, `queryBy...` and their multi-element counterparts are replaced with `page.locator('...')`. Locators always auto-wait and retry when needed, so you don't have to worry about choosing the right method. When you want to do a [list operation](./locators#lists), e.g. assert a list of texts, Playwright automatically performs multi-element opertations.
All queries like `getBy...`, `findBy...`, `queryBy...` and their multi-element counterparts are replaced with `page.locator('...')`. Locators always auto-wait and retry when needed, so you don't have to worry about choosing the right method. When you want to do a [list operation](./locators#lists), e.g. assert a list of texts, Playwright automatically performs multi-element operations.

1. `getByRole`: use [role selector](./selectors#role-selector) `component.locator('role=button[name="Sign up"]')`.
1. `getByText`: use `component.locator('text=some value')` and other variations of the [text selector](./selectors#text-selector).
Expand Down Expand Up @@ -141,7 +141,7 @@ Once you're on Playwright Test, you get a lot!
- Run tests in isolation in parallel across multiple browsers
- Built-in test artifact collection: [video recording](./test-configuration#record-video), [screenshots](./test-configuration#automatic-screenshots) and [playwright traces](./test-configuration#record-test-trace)

Also you get all these ✨ awesome tools ✨ that come bundled with Playwright Test:
You also get all these ✨ awesome tools ✨ that come bundled with Playwright Test:
- [Playwright Inspector](./debug.md)
- [Playwright Test Code generation](./auth#code-generation)
- [Playwright Tracing](./trace-viewer) for post-mortem debugging
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14499,7 +14499,7 @@ export interface FileChooser {
* **Strictness**
*
* Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches
* given selector.
* a given selector.
*
* ```js
* // Throws if there are several frames in DOM:
Expand Down