From 8dbec497a8046b610147de883fbd059d26cecd28 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 13 Aug 2021 18:59:38 +0300 Subject: [PATCH] docs: fix random typos (#8179) --- docs/src/api/class-locator.md | 4 ++-- docs/src/browsers.md | 3 +-- docs/src/test-assertions-js.md | 38 +++++++++++++++++----------------- package-lock.json | 4 ++-- types/types.d.ts | 2 +- 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index e4f132a43f..db54f1a919 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -344,7 +344,7 @@ its value. Examples: ```js -const tweets = await page.locator('.tweet .retweets'); +const tweets = page.locator('.tweet .retweets'); expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets'); ``` @@ -354,7 +354,7 @@ assertEquals("10 retweets", tweets.evaluate("node => node.innerText")); ``` ```python async -tweets = await page.locator(".tweet .retweets") +tweets = page.locator(".tweet .retweets") assert await tweets.evaluate("node => node.innerText") == "10 retweets" ``` diff --git a/docs/src/browsers.md b/docs/src/browsers.md index 0e8bd5f828..d303f98685 100644 --- a/docs/src/browsers.md +++ b/docs/src/browsers.md @@ -3,7 +3,7 @@ id: browsers title: "Browsers" --- -Each version of Playwright needs specific versions of browser binaries to operate. Depending on the language you use, Playwright will either download these browsers at package install time for you will use [Playwright CLI](./cli.md) to install these browsers. +Each version of Playwright needs specific versions of browser binaries to operate. Depending on the language you use, Playwright will either download these browsers at package install time for you, or you will need to use [Playwright CLI](./cli.md) to install these browsers. With every release, Playwright updates the versions of the browsers it supports, so that the latest Playwright would support the latest browsers at any moment. It means that every time you update playwright, you might need to re-run the `install` CLI command. @@ -136,7 +136,6 @@ you can still opt into stable channels on the bots that are typically free of su ## Installing browsers ### Prerequisites for .NET -This conversation was marked as resolved by pavelfeldman * langs: csharp All examples require the `Microsoft.Playwright.CLI` to be installed. You only have to do this once: diff --git a/docs/src/test-assertions-js.md b/docs/src/test-assertions-js.md index 16cc71308c..9e86381a12 100644 --- a/docs/src/test-assertions-js.md +++ b/docs/src/test-assertions-js.md @@ -37,7 +37,7 @@ By default, the timeout for assertions is not set, so it'll wait forever, until Ensures [Locator] points to the checked input. ```js -const locator = await page.locator('.subscribe'); +const locator = page.locator('.subscribe'); await expect(locator).toBeChecked(); ``` @@ -48,7 +48,7 @@ await expect(locator).toBeChecked(); Ensures [Locator] points to a disabled element. ```js -const locator = await page.locator('button.submit'); +const locator = page.locator('button.submit'); await expect(locator).toBeDisabled(); ``` @@ -59,7 +59,7 @@ await expect(locator).toBeDisabled(); Ensures [Locator] points to an editable element. ```js -const locator = await page.locator('input'); +const locator = page.locator('input'); await expect(locator).toBeEditable(); ``` @@ -70,7 +70,7 @@ await expect(locator).toBeEditable(); Ensures [Locator] points to an empty editable element or to a DOM node that has no text. ```js -const locator = await page.locator('div.warning'); +const locator = page.locator('div.warning'); await expect(locator).toBeEmpty(); ``` @@ -81,7 +81,7 @@ await expect(locator).toBeEmpty(); Ensures [Locator] points to an enabled element. ```js -const locator = await page.locator('button.submit'); +const locator = page.locator('button.submit'); await expect(locator).toBeEnabled(); ``` @@ -92,7 +92,7 @@ await expect(locator).toBeEnabled(); Ensures [Locator] points to a focused DOM node. ```js -const locator = await page.locator('input'); +const locator = page.locator('input'); await expect(locator).toBeFocused(); ``` @@ -103,7 +103,7 @@ await expect(locator).toBeFocused(); Ensures [Locator] points to a hidden DOM node, which is the opposite of [visible](./actionability.md#visible). ```js -const locator = await page.locator('.my-element'); +const locator = page.locator('.my-element'); await expect(locator).toBeHidden(); ``` @@ -114,7 +114,7 @@ await expect(locator).toBeHidden(); Ensures [Locator] points to a [visible](./actionability.md#visible) DOM node. ```js -const locator = await page.locator('.my-element'); +const locator = page.locator('.my-element'); await expect(locator).toBeVisible(); ``` @@ -127,7 +127,7 @@ await expect(locator).toBeVisible(); Ensures [Locator] points to a selected option. ```js -const locator = await page.locator('.title'); +const locator = page.locator('.title'); await expect(locator).toContainText('substring'); ``` @@ -140,7 +140,7 @@ await expect(locator).toContainText('substring'); Ensures [Locator] points to an element with given attribute. ```js -const locator = await page.locator('input'); +const locator = page.locator('input'); await expect(locator).toHaveAttribute('type', 'text'); ``` @@ -152,14 +152,14 @@ await expect(locator).toHaveAttribute('type', 'text'); Ensures [Locator] points to an element with given CSS class. ```js -const locator = await page.locator('#component'); +const locator = page.locator('#component'); await expect(locator).toHaveClass(/selected/); ``` Note that if array is passed as an expected value, entire lists can be asserted: ```js -const locator = await page.locator('list > #component'); +const locator = page.locator('list > #component'); await expect(locator).toHaveClass(['component', 'component selected', 'component']); ``` @@ -171,7 +171,7 @@ await expect(locator).toHaveClass(['component', 'component selected', 'component Ensures [Locator] resolves to an exact number of DOM nodes. ```js -const list = await page.locator('list > #component'); +const list = page.locator('list > #component'); await expect(list).toHaveCount(3); ``` @@ -184,7 +184,7 @@ await expect(list).toHaveCount(3); Ensures [Locator] resolves to an element with the given computed CSS style ```js -const locator = await page.locator('button'); +const locator = page.locator('button'); await expect(locator).toHaveCSS('display', 'flex'); ``` @@ -196,7 +196,7 @@ await expect(locator).toHaveCSS('display', 'flex'); Ensures [Locator] points to an element with the given DOM Node ID. ```js -const locator = await page.locator('input'); +const locator = page.locator('input'); await expect(locator).toHaveId('lastname'); ``` @@ -210,7 +210,7 @@ Ensures [Locator] points to an element with given JavaScript property. Note that of a primitive type as well as a plain serializable JavaScript object. ```js -const locator = await page.locator('.component'); +const locator = page.locator('.component'); await expect(locator).toHaveJSProperty('loaded', true); ``` @@ -223,14 +223,14 @@ await expect(locator).toHaveJSProperty('loaded', true); Ensures [Locator] points to an element with the given text. You can use regular expressions for the value as well. ```js -const locator = await page.locator('.title'); +const locator = page.locator('.title'); await expect(locator).toHaveText(/Welcome, .*/); ``` Note that if array is passed as an expected value, entire lists can be asserted: ```js -const locator = await page.locator('list > #component'); +const locator = page.locator('list > #component'); await expect(locator).toHaveText(['Text 1', 'Text 2', 'Text 3']); ``` @@ -264,6 +264,6 @@ await expect(page).toHaveURL(/.*checkout/); Ensures [Locator] points to an element with the given input value. You can use regular expressions for the value as well. ```js -const locator = await page.locator('input[type=number]'); +const locator = page.locator('input[type=number]'); await expect(locator).toHaveValue(/[0-9]/); ``` diff --git a/package-lock.json b/package-lock.json index 6a51fb4f0f..4e593d2145 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "playwright-internal", - "version": "1.14.0-next", + "version": "1.15.0-next", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "playwright-internal", - "version": "1.14.0-next", + "version": "1.15.0-next", "license": "Apache-2.0", "dependencies": { "@babel/code-frame": "^7.14.5", diff --git a/types/types.d.ts b/types/types.d.ts index 2611edaa61..dadb2d5707 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -7046,7 +7046,7 @@ export interface Locator { * Examples: * * ```js - * const tweets = await page.locator('.tweet .retweets'); + * const tweets = page.locator('.tweet .retweets'); * expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets'); * ``` *