chore: fix typos (#20473)

This commit is contained in:
chimurai 2023-01-30 09:53:28 +01:00 committed by GitHub
parent 32724cd5ce
commit f72d400952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 46 additions and 48 deletions

View File

@ -1,7 +1,7 @@
# Tool for printing .exe and .dll dependencies on Windows
This is similar to `ldd` on linux in that loads specified files and tries to
resolve all DLLs referenced by it, printing in the formar `<lib name> => <full path> | "no found"`
resolve all DLLs referenced by it, printing in the format `<lib name> => <full path> | "no found"`
To minimize dependencies we link all C runtime libraries statically, there is
still one dynamic dependency on `dbghelp.dll` which is supposed to be preinstalled
on all Windows machines.
@ -9,4 +9,4 @@ on all Windows machines.
## Build instructions
Open `PrintDeps.sln` solution in Visual Studio 2019 and build `x64/Release` configuration. We
currently commit output binary into `bin/PrintDeps.exe` and bundle it in every npm.
currently commit output binary into `bin/PrintDeps.exe` and bundle it in every npm.

View File

@ -91,7 +91,7 @@ void navigationMenuFlyoutShouldNotHaveAutomaticallyDetectableAccessibilityViolat
### Example 3: Scanning for WCAG violations
By default, axe checks against a wide variety of accessibility rules. Some of these rules correspond to specific success criteria from the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG21/), and others are "best practice" rules that are not specifically required by any WCAG criteron.
By default, axe checks against a wide variety of accessibility rules. Some of these rules correspond to specific success criteria from the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG21/), and others are "best practice" rules that are not specifically required by any WCAG criterion.
You can constrain an accessibility scan to only run those rules which are "tagged" as corresponding to specific WCAG success criteria by using [`AxeBuilder.withTags()`](https://github.com/dequelabs/axe-core-maven-html/blob/develop/playwright/README.md#axebuilderwithtagsliststring-rules). For example, [Accessibility Insights for Web's Automated Checks](https://accessibilityinsights.io/docs/web/getstarted/fastpass/?referrer=playwright-accessibility-testing-java) only include axe rules that test for violations of WCAG A and AA success criteria; to match that behavior, you would use the tags `wcag2a`, `wcag2aa`, `wcag21a`, and `wcag21aa`.
@ -165,7 +165,7 @@ shouldOnlyHaveAccessibilityViolationsMatchingKnownFingerprints() throws Exceptio
AxeResults accessibilityScanResults = new AxeBuilder(page).analyze();
List<ViolationFingerprint> violationFingerprints = fingerprintsFromScanResults(accessibilityScanResults);
assertEquals(Arrays.asList(
new ViolationFingerprint("aria-roles", "[span[role=\"invalid\"]]"),
new ViolationFingerprint("color-contrast", "[li:nth-child(2) > span]"),

View File

@ -91,7 +91,7 @@ test('navigation menu flyout should not have automatically detectable accessibil
### Scanning for WCAG violations
By default, axe checks against a wide variety of accessibility rules. Some of these rules correspond to specific success criteria from the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG21/), and others are "best practice" rules that are not specifically required by any WCAG criteron.
By default, axe checks against a wide variety of accessibility rules. Some of these rules correspond to specific success criteria from the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG21/), and others are "best practice" rules that are not specifically required by any WCAG criterion.
You can constrain an accessibility scan to only run those rules which are "tagged" as corresponding to specific WCAG success criteria by using [`AxeBuilder.withTags()`](https://github.com/dequelabs/axe-core-npm/blob/develop/packages/playwright/README.md#axebuilderwithtagstags-stringarray). For example, [Accessibility Insights for Web's Automated Checks](https://accessibilityinsights.io/docs/web/getstarted/fastpass/?referrer=playwright-accessibility-testing-js) only include axe rules that test for violations of WCAG A and AA success criteria; to match that behavior, you would use the tags `wcag2a`, `wcag2aa`, `wcag21a`, and `wcag21aa`.

View File

@ -448,7 +448,7 @@ When all steps combined have not finished during the specified [`option: timeout
## async method: Locator.dispatchEvent
* since: v1.14
Programmaticaly dispatch an event on the matching element.
Programmatically dispatch an event on the matching element.
**Usage**
@ -1427,7 +1427,7 @@ A page this locator belongs to.
## async method: Locator.press
* since: v1.14
Focuses the mathing element and presses a combintation of the keys.
Focuses the matching element and presses a combination of the keys.
**Usage**

View File

@ -119,7 +119,7 @@ playwright codegen --timezone="Europe/Rome" --geolocation="41.890221,12.492348"
pwsh bin/Debug/netX/playwright.ps1 codegen --timezone="Europe/Rome" --geolocation="41.890221,12.492348" --lang="it-IT" maps.google.com
```
<img width="1276" alt="Codegen generating code for tests for google maps showing timezone, geoloation as Rome, Italy and in Italian language" src="https://user-images.githubusercontent.com/13063165/182394434-73e1c2a8-767e-411a-94e4-0912c1c50ecc.png" />
<img width="1276" alt="Codegen generating code for tests for google maps showing timezone, geolocation as Rome, Italy and in Italian language" src="https://user-images.githubusercontent.com/13063165/182394434-73e1c2a8-767e-411a-94e4-0912c1c50ecc.png" />
## Preserve authenticated state

View File

@ -101,7 +101,7 @@ The key differences to note are as follows:
| Installation | `npm install playwright` | `npm init playwright@latest` - note `install` vs. `init` |
| Install browsers | Chromium, Firefox, WebKit are installed by default | `npx playwright install` or `npx playwright install chromium` for a single one |
| `import`/`require` name | `playwright` | `@playwright/test` |
| Initialization | Explicitly need to: <ol><li>Pick a browser to use, e.g. `chromium`</li><li>Launch browser with [`method: BrowserType.launch`]</li><li>Create a context with [`method: Browser.newContext`], <em>and</em> pass any context options explcitly, e.g. `devices['iPhone 11']`</li><li>Create a page with [`method: BrowserContext.newPage`]</li></ol> | An isolated `page` and `context` are provided to each test out-of the box, along with other [built-in fixtures](./test-fixtures.md#built-in-fixtures). No explicit creation. If referenced by the test in it's arguments, the Test Runner will create them for the test. (i.e. lazy-initialization) |
| Initialization | Explicitly need to: <ol><li>Pick a browser to use, e.g. `chromium`</li><li>Launch browser with [`method: BrowserType.launch`]</li><li>Create a context with [`method: Browser.newContext`], <em>and</em> pass any context options explicitly, e.g. `devices['iPhone 11']`</li><li>Create a page with [`method: BrowserContext.newPage`]</li></ol> | An isolated `page` and `context` are provided to each test out-of the box, along with other [built-in fixtures](./test-fixtures.md#built-in-fixtures). No explicit creation. If referenced by the test in it's arguments, the Test Runner will create them for the test. (i.e. lazy-initialization) |
| Assertions | No built-in Web-First Assertions | [Web-First assertions](./test-assertions.md) like: <ul><li>[`method: PageAssertions.toHaveTitle`]</li><li>[`method: PageAssertions.toHaveScreenshot#1`]</li></ul> which auto-wait and retry for the condition to be met.|
| Cleanup | Explicitly need to: <ol><li>Close context with [`method: BrowserContext.close`]</li><li>Close browser with [`method: Browser.close`]</li></ol> | No explicit close of [built-in fixtures](./test-fixtures.md#built-in-fixtures); the Test Runner will take care of it.
| Running | When using the Library, you run the code as a node script, possibly with some compilation first. | When using the Test Runner, you use the `npx playwright test` command. Along with your [config](./test-configuration.md), the Test Runner handles any compilation and choosing what to run and how to run it. |

View File

@ -66,7 +66,7 @@ await page.route('https://dog.ceo/api/breeds/list/all', async route => {
const response = await route.fetch();
const json = await response.json();
json.message['big_red_dog'] = [];
// Fullfill using the original response, while patching the response body
// Fulfill using the original response, while patching the response body
// with the given JSON object.
await route.fulfill({ response, json });
});
@ -77,7 +77,7 @@ async def handle(route):
response = await route.fulfill()
json = await response.json()
json["message"]["big_red_dog"] = []
# Fullfill using the original response, while patching the response body
# Fulfill using the original response, while patching the response body
# with the given JSON object.
await route.fulfill(response=response, json=json)
@ -89,7 +89,7 @@ def handle(route):
response = route.fulfill()
json = response.json()
json["message"]["big_red_dog"] = []
# Fullfill using the original response, while patching the response body
# Fulfill using the original response, while patching the response body
# with the given JSON object.
route.fulfill(response=response, json=json)
@ -102,7 +102,7 @@ await page.RouteAsync("https://dog.ceo/api/breeds/list/all", async route =>
var response = await route.FetchAsync();
dynamic json = await response.JsonAsync();
json.message.big_red_dog = new string[] {};
// Fullfill using the original response, while patching the response body
// Fulfill using the original response, while patching the response body
// with the given JSON object.
await route.FulfillAsync(new() { Response = response, Json = json });
});
@ -114,7 +114,7 @@ page.route("https://dog.ceo/api/breeds/list/all", route -> {
JsonObject json = new Gson().fromJson(response.text(), JsonObject.class);
JsonObject message = json.get("message").getAsJsonObject();
message.set("big_red_dog", new JsonArray());
// Fullfill using the original response, while patching the response body
// Fulfill using the original response, while patching the response body
// with the given JSON object.
route.fulfill(new Route.FulfillOptions()
.setResponse(response)

View File

@ -13,7 +13,7 @@ In addition to recommended locators like [`method: Page.getByRole`] and [`method
## CSS locator
:::note
We recommend prioritzing [user-visible locators](./locators.md#quick-guide) like text or accessible role instead of using CSS that is tied to the implementation and could break when the page changes.
We recommend prioritizing [user-visible locators](./locators.md#quick-guide) like text or accessible role instead of using CSS that is tied to the implementation and could break when the page changes.
:::
Playwright can locate an element by CSS selector.
@ -42,7 +42,7 @@ Playwright augments standard CSS selectors in two ways:
Playwright include a number of CSS pseudo-classes to match elements by their text content.
- `article:has-text("Playwright")` - the `:has-text()` matches any element containing specified text somewhere inside, possibly in a child or a descendant element. Matching is case-insensitive, trims whitestapce and searches for a substring.
- `article:has-text("Playwright")` - the `:has-text()` matches any element containing specified text somewhere inside, possibly in a child or a descendant element. Matching is case-insensitive, trims whitespace and searches for a substring.
For example, `article:has-text("Playwright")` matches `<article><div>Playwright</div></article>`.
@ -122,7 +122,7 @@ Input elements of the type `button` and `submit` are matched by their `value` in
### CSS: matching only visible elements
Playwrigt supports the `:visible` pseudo class in CSS selectors. For example, `css=button` matches all the buttons on the page, while `css=button:visible` only matches visible buttons. This is useful to distinguish elements that are very similar but differ in visibility.
Playwright supports the `:visible` pseudo class in CSS selectors. For example, `css=button` matches all the buttons on the page, while `css=button:visible` only matches visible buttons. This is useful to distinguish elements that are very similar but differ in visibility.
Consider a page with two buttons, first invisible and second visible.
@ -618,7 +618,7 @@ Vue locator, as well as [Vue DevTools](https://chrome.google.com/webstore/detail
## XPath locator
:::warning
We recommend prioritzing [user-visible locators](./locators.md#quick-guide) like text or accessible role instead of using XPath that is tied to the implementation and easily break when the page changes.
We recommend prioritizing [user-visible locators](./locators.md#quick-guide) like text or accessible role instead of using XPath that is tied to the implementation and easily break when the page changes.
:::
XPath locators are equivalent to calling [`Document.evaluate`](https://developer.mozilla.org/en/docs/Web/API/Document/evaluate).

View File

@ -65,7 +65,7 @@ Worker serviceWorker = page.waitForRequest(() -> {
[`event: BrowserContext.serviceWorker`] is fired ***before*** the Service Worker's main script has been evaluated, so ***before*** calling service[`method: Worker.evaluate`] you should wait on its activation.
There are more iodiomatic methods of waiting for a Service Worker to be activated, but the following is an implementation agnostic method:
There are more idiomatic methods of waiting for a Service Worker to be activated, but the following is an implementation agnostic method:
```js tab=js-ts
await page.evaluate(async () => {
@ -219,7 +219,7 @@ self.addEventListener("fetch", (event) => {
// 3. Prevent tracker.js from being retrieved, and returns a placeholder response
if (event.request.url.endsWith("tracker.js"))
return new Response('conosole.log("no trackers!")', {
return new Response('console.log("no trackers!")', {
status: 200,
headers: { "Content-Type": "text/javascript" },
});

View File

@ -830,7 +830,7 @@ An object containing fixtures and/or options. Learn more about [fixtures format]
## method: Test.fail#1
* since: v1.10
Unconditonally marks a test as "should fail". Playwright Test runs this test and ensures that it is actually failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is fixed.
Unconditionally marks a test as "should fail". Playwright Test runs this test and ensures that it is actually failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is fixed.
**Usage**

View File

@ -425,7 +425,7 @@ However, most common ones like `headless` or `viewport` are available directly i
## Explicit Context Creation and Option Inheritance
If using the built-in `browser` fixture, calling [`method: Browser.newContext`] will create a context with options inherted from the config:
If using the built-in `browser` fixture, calling [`method: Browser.newContext`] will create a context with options inherited from the config:
```js tab=js-ts
// playwright.config.ts

View File

@ -200,7 +200,7 @@ test(`example test`, async ({ page }) => {
});
```
You can run this test with your secrect username and password set in the command line.
You can run this test with your secret username and password set in the command line.
```bash tab=bash-bash
USERNAME=me PASSWORD=secret npx playwright test

View File

@ -479,7 +479,7 @@ test('using specific annotations for passing test metadata to Xray', async ({},
});
```
Please note that the semantics of these properties will depend on the tool that will process this evoled report format; there are no standard property names/annotations.
Please note that the semantics of these properties will depend on the tool that will process this evolved report format; there are no standard property names/annotations.
If the configuration option `embedAttachmentsAsProperty` is defined, then a `property` with its name is created. Attachments, including their contents, will be embedded on the JUnit XML report inside `<item>` elements under this `property`. Attachments are obtained from the `TestInfo` object, using either a path or a body, and are added as base64 encoded content.
Embedding attachments can be used to attach screenshots or any other relevant evidence; nevertheless, use it wisely as it affects the report size.

View File

@ -10496,7 +10496,7 @@ export interface Locator {
}): Promise<void>;
/**
* Programmaticaly dispatch an event on the matching element.
* Programmatically dispatch an event on the matching element.
*
* **Usage**
*
@ -11405,7 +11405,7 @@ export interface Locator {
page(): Page;
/**
* Focuses the mathing element and presses a combintation of the keys.
* Focuses the matching element and presses a combination of the keys.
*
* **Usage**
*

View File

@ -2757,7 +2757,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
*/
fixme(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
/**
* Unconditonally marks a test as "should fail". Playwright Test runs this test and ensures that it is actually
* Unconditionally marks a test as "should fail". Playwright Test runs this test and ensures that it is actually
* failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is
* fixed.
*

View File

@ -3,6 +3,6 @@ Tests derived from axe-core test suite: https://github.com/dequelabs/axe-core/tr
Includes:
- `LICENSE`
Modifed:
Modified:
- `implicit-role.js` contains test cases extracted from `/test/commons/aria/implicit-role.js`
- `accessible-text.js` contains test cases extracted from `/test/commons/aria/accessible-text.js`

View File

@ -6,5 +6,5 @@ Includes:
- `accname/foo.jpg`
- `wai-aria/scripts/manual.css`
Modifed:
Modified:
- `wai-aria/scripts/ATTAcomm.js` contains our own harness to avoid modifying test files

View File

@ -1,5 +1,3 @@
# Chrome non-determenistic rendering
# Chrome non-deterministic rendering
Reported by: https://bugs.chromium.org/p/chromium/issues/detail?id=919955

View File

@ -1,5 +1,5 @@
# Tiny anti-aliasing sample
This is a 10x10 image sample with a 3 anti-aliased pixels in-between. This is actually
a cropped down snapshot of one of the [ubuntu-x86-vs-ubunu-arm samples](../ubuntu-x86-vs-ubuntu-arm/samples/stylings_stories-Stylings-stories-Texture-bar-should-use-custom-path-chrome/stylings-stories/texture/bar/should-use-custom-path-actual.png) handy for debugging
a cropped down snapshot of one of the [ubuntu-x86-vs-ubuntu-arm samples](../ubuntu-x86-vs-ubuntu-arm/samples/stylings_stories-Stylings-stories-Texture-bar-should-use-custom-path-chrome/stylings-stories/texture/bar/should-use-custom-path-actual.png) handy for debugging
purposes.

View File

@ -171,7 +171,7 @@ it('should support offline option', async ({ server, launchPersistent }) => {
});
it('should support acceptDownloads option', async ({ server, launchPersistent, mode }) => {
it.skip(mode !== 'default', 'download.path() is not avaialble in remote mode');
it.skip(mode !== 'default', 'download.path() is not available in remote mode');
const { page } = await launchPersistent();
server.setRoute('/download', (req, res) => {

View File

@ -21,7 +21,7 @@ it('should load svg favicon with prefer-color-scheme', async ({ page, server, br
it.skip(headless && browserName !== 'firefox', 'headless browsers, except firefox, do not request favicons');
it.skip(!headless && browserName === 'webkit' && !channel, 'headed webkit does not have a favicon feature');
// Browsers aggresively cache favicons, so force bust with the
// Browsers aggressively cache favicons, so force bust with the
// `d` parameter to make iterating on this test more predictable and isolated.
const favicon = `/favicon.svg?d=${Date.now()}`;
server.setRoute(favicon, (req, res) => {

View File

@ -131,7 +131,7 @@ browserTest.describe('page screenshot', () => {
});
browserTest('should work with large size', async ({ browserName, headless, platform, contextFactory }) => {
browserTest.fixme(browserName === 'chromium' && !headless && platform === 'linux', 'Chromium has gpu problems on linux with large screnshots');
browserTest.fixme(browserName === 'chromium' && !headless && platform === 'linux', 'Chromium has gpu problems on linux with large screenshots');
browserTest.slow(true, 'Large screenshot is slow');
const context = await contextFactory();

View File

@ -28,7 +28,7 @@ it('should send all of the correct events @smoke', async ({ page }) => {
await page.tap('#a');
const eventsHandle = await trackEvents(await page.$('#b'));
await page.tap('#b');
// webkit doesnt send pointerenter or pointerleave or mouseout
// webkit doesn't send pointerenter or pointerleave or mouseout
expect(await eventsHandle.jsonValue()).toEqual([
'pointerover', 'pointerenter',
'pointerdown', 'touchstart',
@ -96,7 +96,7 @@ it('should wait for a navigation caused by a tap', async ({ page, server }) => {
let resolved = false;
const tapPromise = page.tap('a').then(() => resolved = true);
const response = await responsePromise;
// make sure the tap doesnt resolve too early
// make sure the tap doesn't resolve too early
await new Promise(x => setTimeout(x, 100));
expect(resolved).toBe(false);

View File

@ -356,7 +356,7 @@ it('should properly serialize PerformanceMeasure object', async ({ page }) => {
}]);
});
it('shuld properly serialize window.performance object', async ({ page }) => {
it('should properly serialize window.performance object', async ({ page }) => {
expect(await page.evaluate(() => performance)).toEqual({
'navigation': {
'redirectCount': 0,
@ -482,7 +482,7 @@ it('should not throw an error when evaluation does a navigation', async ({ page,
});
it('should not throw an error when evaluation does a synchronous navigation and returns an object', async ({ page, server, browserName }) => {
// It is imporant to be on about:blank for sync reload.
// It is important to be on about:blank for sync reload.
const result = await page.evaluate(() => {
window.location.reload();
return { a: 42 };
@ -491,7 +491,7 @@ it('should not throw an error when evaluation does a synchronous navigation and
});
it('should not throw an error when evaluation does a synchronous navigation and returns undefined', async ({ page }) => {
// It is imporant to be on about:blank for sync reload.
// It is important to be on about:blank for sync reload.
const result = await page.evaluate(() => {
window.location.reload();
return undefined;

View File

@ -132,7 +132,7 @@ it('should resolve responses after a navigation', async ({ page, server, browser
const responsePromise = request.response();
// navigate, which should cancel the request
await page.goto(server.CROSS_PROCESS_PREFIX);
// make sure we arent stalling this request on the server
// make sure we aren't stalling this request on the server
responseFromServer.end('done');
// the response should resolve to null, because the page navigated.
expect(await responsePromise).toBe(null);

View File

@ -73,11 +73,11 @@ for (const [name, url] of Object.entries(reacts)) {
it('should exact match by props', async ({ page }) => {
await expect(page.locator(`_react=BookItem[name = "The Great Gatsby"]`)).toHaveText('The Great Gatsby');
await expect(page.locator(`_react=BookItem[name = "The Great Gatsby"]`)).toHaveCount(1);
// case sensetive by default
// case sensitive by default
await expect(page.locator(`_react=BookItem[name = "the great gatsby"]`)).toHaveCount(0);
await expect(page.locator(`_react=BookItem[name = "the great gatsby" s]`)).toHaveCount(0);
await expect(page.locator(`_react=BookItem[name = "the great gatsby" S]`)).toHaveCount(0);
// case insensetive with flag
// case insensitive with flag
await expect(page.locator(`_react=BookItem[name = "the great gatsby" i]`)).toHaveCount(1);
await expect(page.locator(`_react=BookItem[name = "the great gatsby" I]`)).toHaveCount(1);
await expect(page.locator(`_react=BookItem[name = " The Great Gatsby "]`)).toHaveCount(0);

View File

@ -350,7 +350,7 @@ test('should work without config file', async ({ runInlineTest }) => {
expect(skipped).toBe(0);
});
test('should inerhit use options in projects', async ({ runInlineTest }) => {
test('should inherit use options in projects', async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright.config.ts': `
module.exports = {

View File

@ -386,7 +386,7 @@ test('should render all annotations to testcase value based properties, if reque
expect(result.exitCode).toBe(0);
});
test('should embed attachments to a custom testcase property, if explictly requested', async ({ runInlineTest }) => {
test('should embed attachments to a custom testcase property, if explicitly requested', async ({ runInlineTest }) => {
const result = await runInlineTest({
'playwright.config.ts': `
const xrayOptions = {
@ -425,7 +425,7 @@ test('should embed attachments to a custom testcase property, if explictly reque
expect(result.exitCode).toBe(0);
});
test('should not embed attachments to a custom testcase property, if not explictly requested', async ({ runInlineTest }) => {
test('should not embed attachments to a custom testcase property, if not explicitly requested', async ({ runInlineTest }) => {
const result = await runInlineTest({
'a.test.js': `
const { test } = pwt;

View File

@ -43,7 +43,7 @@ test('should not leak fixtures w/o page', async ({}) => {
test('should not leak server-side objects', async ({ page }) => {
expect(await queryObjectCount(require('../../packages/playwright-core/lib/server/page').Page)).toBe(1);
// 4 is because v8 heap creates obejcts for descendant classes, so WKContext, CRContext, FFContext and our context instance.
// 4 is because v8 heap creates objects for descendant classes, so WKContext, CRContext, FFContext and our context instance.
expect(await queryObjectCount(require('../../packages/playwright-core/lib/server/browserContext').BrowserContext)).toBe(4);
expect(await queryObjectCount(require('../../packages/playwright-core/lib/server/browser').Browser)).toBe(4);
});