From 150cbcbdf32b270990f9930515281f5a814af3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Wed, 8 May 2024 20:40:03 +0200 Subject: [PATCH] chore: fix typos (#30645) --- docs/src/api/class-locatorassertions.md | 4 ++-- docs/src/api/params.md | 4 ++-- docs/src/codegen.md | 2 +- docs/src/test-api/class-test.md | 2 +- docs/src/test-cli-js.md | 4 ++-- docs/src/test-parallel-js.md | 2 +- .../src/server/chromium/crPage.ts | 2 +- .../src/server/dispatchers/dispatcher.ts | 2 +- .../src/server/dispatchers/jsHandleDispatcher.ts | 2 +- packages/playwright-core/src/server/frames.ts | 2 +- .../playwright-core/src/server/har/harTracer.ts | 2 +- .../src/server/injected/roleUtils.ts | 2 +- packages/playwright-core/src/server/input.ts | 2 +- packages/playwright-core/types/types.d.ts | 16 ++++++++-------- packages/playwright/src/common/esmLoaderHost.ts | 2 +- packages/playwright/src/common/fixtures.ts | 2 +- .../playwright/src/matchers/toMatchSnapshot.ts | 2 +- packages/playwright/src/reporters/merge.ts | 2 +- packages/playwright/src/worker/fixtureRunner.ts | 2 +- packages/playwright/src/worker/workerMain.ts | 4 ++-- packages/playwright/types/test.d.ts | 4 ++-- .../ct-vue-cli/tests/events/events.spec.ts | 2 +- .../ct-vue-cli/tests/events/events.spec.tsx | 2 +- .../ct-vue-vite/tests/events/events.spec.js | 2 +- .../ct-vue-vite/tests/events/events.spec.ts | 2 +- .../ct-vue-vite/tests/events/events.spec.tsx | 2 +- tests/config/testserver/index.ts | 6 +++--- tests/installation/fixture-scripts/screencast.js | 2 +- tests/library/hit-target.spec.ts | 2 +- tests/library/inspector/cli-codegen-2.spec.ts | 2 +- tests/page/locator-query.spec.ts | 2 +- tests/page/page-click.spec.ts | 2 +- tests/page/page-focus.spec.ts | 2 +- tests/page/page-route.spec.ts | 2 +- tests/playwright-test/clear-cache.spec.ts | 2 +- tests/playwright-test/expect.spec.ts | 4 ++-- tests/playwright-test/reporter-blob.spec.ts | 4 ++-- tests/playwright-test/test-tag.spec.ts | 2 +- tests/third_party/proxy/index.ts | 4 ++-- utils/generate_types/index.js | 6 +++--- utils/generate_types/test/test.ts | 4 ++-- 41 files changed, 61 insertions(+), 61 deletions(-) diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md index 6b6bac7c09..c06f906e3d 100644 --- a/docs/src/api/class-locatorassertions.md +++ b/docs/src/api/class-locatorassertions.md @@ -910,10 +910,10 @@ await expect( assertThat(page.getByText("Welcome")).isVisible(); // At least one item in the list is visible. -asserThat(page.getByTestId("todo-item").first()).isVisible(); +assertThat(page.getByTestId("todo-item").first()).isVisible(); // At least one of the two elements is visible, possibly both. -asserThat( +assertThat( page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign in")) .or(page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign up"))) .first() diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 84e7a7449e..ffff0a800e 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -571,7 +571,7 @@ Whether to emulate network being offline. Defaults to `false`. Learn more about - `username` <[string]> - `password` <[string]> - `origin` ?<[string]> Restrain sending http credentials on specific origin (scheme://host:port). - - `sendImmediately` ?<[boolean]> Whether to send `Authorization` header with the first API request. By deafult, the credentials are sent only when 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent from the browser. + - `sendImmediately` ?<[boolean]> Whether to send `Authorization` header with the first API request. By default, the credentials are sent only when 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent from the browser. Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no origin is specified, the username and password are sent to any servers upon unauthorized responses. @@ -751,7 +751,7 @@ Whether to allow sites to register Service workers. Defaults to `'allow'`. * since: v1.41 - `behavior` <[UnrouteBehavior]<"wait"|"ignoreErrors"|"default">> -Specifies wether to wait for already running handlers and what to do if they throw errors: +Specifies whether to wait for already running handlers and what to do if they throw errors: * `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may result in unhandled error * `'wait'` - wait for current handler calls (if any) to finish * `'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers after unrouting are silently caught diff --git a/docs/src/codegen.md b/docs/src/codegen.md index 55136e6ac8..5f11bdade3 100644 --- a/docs/src/codegen.md +++ b/docs/src/codegen.md @@ -371,7 +371,7 @@ pwsh bin/Debug/netX/playwright.ps1 codegen github.com/microsoft/playwright --sav After performing authentication and closing the browser, `auth.json` will contain the storage state which you can then reuse in your tests. -login to Github screen +login to GitHub screen Make sure you only use the `auth.json` locally as it contains sensitive information. Add it to your `.gitignore` or delete it once you have finished generating your tests. diff --git a/docs/src/test-api/class-test.md b/docs/src/test-api/class-test.md index f00e125215..9b56fbf2e6 100644 --- a/docs/src/test-api/class-test.md +++ b/docs/src/test-api/class-test.md @@ -195,7 +195,7 @@ test('my test', async ({ page }) => { }); ``` -Alternatively, you can delcare a hook **with a title**. +Alternatively, you can declare a hook **with a title**. ```js title="example.spec.ts" test.afterEach('Status check', async ({ page }) => { diff --git a/docs/src/test-cli-js.md b/docs/src/test-cli-js.md index 57f7393517..6bfb213454 100644 --- a/docs/src/test-cli-js.md +++ b/docs/src/test-cli-js.md @@ -83,8 +83,8 @@ Complete set of Playwright Test options is available in the [configuration file] | `--debug`| Run tests with Playwright Inspector. Shortcut for `PWDEBUG=1` environment variable and `--timeout=0 --max-failures=1 --headed --workers=1` options.| | `--forbid-only` | Whether to disallow `test.only`. Useful on CI.| | `--global-timeout ` | Total timeout for the whole test run in milliseconds. By default, there is no global timeout. Learn more about [various timeouts](./test-timeouts.md).| -| `-g ` or `--grep ` | Only run tests matching this regular expression. For example, this will run `'should add to cart'` when passed `-g "add to cart"`. The regular expression will be tested against the string that consists of the test file name, `test.describe` titles if any, test title and all test tags, separated by spaces, e.g. `my-test.spec.ts my-suite my-test @smoke`. The filter does not apply to the tests from dependcy projects, i.e. Playwright will still run all tests from [project dependencies](./test-projects.md#dependencies). | -| `--grep-invert ` | Only run tests **not** matching this regular expression. The opposite of `--grep`. The filter does not apply to the tests from dependcy projects, i.e. Playwright will still run all tests from [project dependencies](./test-projects.md#dependencies).| +| `-g ` or `--grep ` | Only run tests matching this regular expression. For example, this will run `'should add to cart'` when passed `-g "add to cart"`. The regular expression will be tested against the string that consists of the test file name, `test.describe` titles if any, test title and all test tags, separated by spaces, e.g. `my-test.spec.ts my-suite my-test @smoke`. The filter does not apply to the tests from dependency projects, i.e. Playwright will still run all tests from [project dependencies](./test-projects.md#dependencies). | +| `--grep-invert ` | Only run tests **not** matching this regular expression. The opposite of `--grep`. The filter does not apply to the tests from dependency projects, i.e. Playwright will still run all tests from [project dependencies](./test-projects.md#dependencies).| | `--headed` | Run tests in headed browsers. Useful for debugging. | | `--ignore-snapshots` | Whether to ignore [snapshots](./test-snapshots.md). Use this when snapshot expectations are known to be different, e.g. running tests on Linux against Windows screenshots. | | `--last-failed` | Only re-run the failures.| diff --git a/docs/src/test-parallel-js.md b/docs/src/test-parallel-js.md index 39ce85fa48..9643ed6f7a 100644 --- a/docs/src/test-parallel-js.md +++ b/docs/src/test-parallel-js.md @@ -183,7 +183,7 @@ export const test = baseTest.extend<{}, { dbUserName: string }>({ dbUserName: [async ({ }, use) => { // Use workerIndex as a unique identifier for each worker. const userName = `user-${test.info().workerIndex}`; - // Inialize user in the database. + // Initialize user in the database. await createUserInTestDatabase(userName); await use(userName); // Clean up after the tests are done. diff --git a/packages/playwright-core/src/server/chromium/crPage.ts b/packages/playwright-core/src/server/chromium/crPage.ts index 2828991e11..8150fe61cd 100644 --- a/packages/playwright-core/src/server/chromium/crPage.ts +++ b/packages/playwright-core/src/server/chromium/crPage.ts @@ -686,7 +686,7 @@ class FrameSession { return; } if (reason === 'swap') { - // This is a local -> remote frame transtion, where + // This is a local -> remote frame transition, where // Page.frameDetached arrives before Target.attachedToTarget. // We should keep the frame in the tree, and it will be used for the new target. const frame = this._page._frameManager.frame(frameId); diff --git a/packages/playwright-core/src/server/dispatchers/dispatcher.ts b/packages/playwright-core/src/server/dispatchers/dispatcher.ts index 44d68c73a2..837a634e09 100644 --- a/packages/playwright-core/src/server/dispatchers/dispatcher.ts +++ b/packages/playwright-core/src/server/dispatchers/dispatcher.ts @@ -349,7 +349,7 @@ export class DispatcherConnection { } } response.error = serializeError(e); - // The command handler could have set error in the metada, do not reset it if there was no exception. + // The command handler could have set error in the metadata, do not reset it if there was no exception. callMetadata.error = response.error; } finally { callMetadata.endTime = monotonicTime(); diff --git a/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts b/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts index 547c499746..07e9d38ee5 100644 --- a/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts +++ b/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts @@ -75,7 +75,7 @@ export class JSHandleDispatcher extends Dispatcher (a as JSHandleDispatcher)._object)); } diff --git a/packages/playwright-core/src/server/frames.ts b/packages/playwright-core/src/server/frames.ts index 73aa1f4dae..e2b1eec2a5 100644 --- a/packages/playwright-core/src/server/frames.ts +++ b/packages/playwright-core/src/server/frames.ts @@ -76,7 +76,7 @@ export type NavigationEvent = { // Error for cross-document navigations if any. When error is present, // the navigation did not commit. error?: Error, - // Wether this event should be visible to the clients via the public APIs. + // Whether this event should be visible to the clients via the public APIs. isPublic?: boolean; }; diff --git a/packages/playwright-core/src/server/har/harTracer.ts b/packages/playwright-core/src/server/har/harTracer.ts index d86b9f6758..289a4f6d87 100644 --- a/packages/playwright-core/src/server/har/harTracer.ts +++ b/packages/playwright-core/src/server/har/harTracer.ts @@ -351,7 +351,7 @@ export class HarTracer { }); this._addBarrier(page || request.serviceWorker(), promise); - // Respose end timing is only available after the response event was received. + // Response end timing is only available after the response event was received. const timing = response.timing(); harEntry.timings.receive = response.request()._responseEndTiming !== -1 ? helper.millisToRoundishMillis(response.request()._responseEndTiming - timing.responseStart) : -1; this._computeHarEntryTotalTime(harEntry); diff --git a/packages/playwright-core/src/server/injected/roleUtils.ts b/packages/playwright-core/src/server/injected/roleUtils.ts index a1c2b07280..57681e0542 100644 --- a/packages/playwright-core/src/server/injected/roleUtils.ts +++ b/packages/playwright-core/src/server/injected/roleUtils.ts @@ -625,7 +625,7 @@ function getTextAlternativeInternal(element: Element, options: AccessibleNameOpt if (trimFlatString(title)) return title; // SPEC DIFFERENCE. - // Spec says return localized "Submit Query", but browsers and axe-core insist on "Sumbit". + // Spec says return localized "Submit Query", but browsers and axe-core insist on "Submit". return 'Submit'; } diff --git a/packages/playwright-core/src/server/input.ts b/packages/playwright-core/src/server/input.ts index a70ee114a4..f09f91b86f 100644 --- a/packages/playwright-core/src/server/input.ts +++ b/packages/playwright-core/src/server/input.ts @@ -282,7 +282,7 @@ function buildLayoutClosure(layout: keyboardLayout.KeyboardLayout): Map { ... descrption, shifted } + // Map from code: Digit3 -> { ... description, shifted } result.set(code, { ...description, shifted: shiftedDescription }); // Map from aliases: Shift -> non-shiftable definition diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index fbba3e7f9a..6fd38100a0 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -4390,7 +4390,7 @@ export interface Page { */ unrouteAll(options?: { /** - * Specifies wether to wait for already running handlers and what to do if they throw errors: + * Specifies whether to wait for already running handlers and what to do if they throw errors: * - `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may * result in unhandled error * - `'wait'` - wait for current handler calls (if any) to finish @@ -8827,7 +8827,7 @@ export interface BrowserContext { */ unrouteAll(options?: { /** - * Specifies wether to wait for already running handlers and what to do if they throw errors: + * Specifies whether to wait for already running handlers and what to do if they throw errors: * - `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may * result in unhandled error * - `'wait'` - wait for current handler calls (if any) to finish @@ -13378,7 +13378,7 @@ export interface BrowserType { origin?: string; /** - * Whether to send `Authorization` header with the first API request. By deafult, the credentials are sent only when + * Whether to send `Authorization` header with the first API request. By default, the credentials are sent only when * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent * from the browser. */ @@ -14901,7 +14901,7 @@ export interface AndroidDevice { origin?: string; /** - * Whether to send `Authorization` header with the first API request. By deafult, the credentials are sent only when + * Whether to send `Authorization` header with the first API request. By default, the credentials are sent only when * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent * from the browser. */ @@ -15632,7 +15632,7 @@ export interface APIRequest { origin?: string; /** - * Whether to send `Authorization` header with the first API request. By deafult, the credentials are sent only when + * Whether to send `Authorization` header with the first API request. By default, the credentials are sent only when * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent * from the browser. */ @@ -16783,7 +16783,7 @@ export interface Browser extends EventEmitter { origin?: string; /** - * Whether to send `Authorization` header with the first API request. By deafult, the credentials are sent only when + * Whether to send `Authorization` header with the first API request. By default, the credentials are sent only when * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent * from the browser. */ @@ -17677,7 +17677,7 @@ export interface Electron { origin?: string; /** - * Whether to send `Authorization` header with the first API request. By deafult, the credentials are sent only when + * Whether to send `Authorization` header with the first API request. By default, the credentials are sent only when * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent * from the browser. */ @@ -20344,7 +20344,7 @@ export interface HTTPCredentials { origin?: string; /** - * Whether to send `Authorization` header with the first API request. By deafult, the credentials are sent only when + * Whether to send `Authorization` header with the first API request. By default, the credentials are sent only when * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent * from the browser. */ diff --git a/packages/playwright/src/common/esmLoaderHost.ts b/packages/playwright/src/common/esmLoaderHost.ts index f165318c08..4b38ea6670 100644 --- a/packages/playwright/src/common/esmLoaderHost.ts +++ b/packages/playwright/src/common/esmLoaderHost.ts @@ -61,7 +61,7 @@ export async function incorporateCompilationCache() { if (!loaderChannel) return; // This is needed to gather dependency information from the esm loader - // that is populated from the resovle hook. We do not need to push + // that is populated from the resolve hook. We do not need to push // this information proactively during load, but gather it at the end. const result = await loaderChannel.send('getCompilationCache', {}); addToCompilationCache(result.cache); diff --git a/packages/playwright/src/common/fixtures.ts b/packages/playwright/src/common/fixtures.ts index 8d2c7c2304..aa3886718c 100644 --- a/packages/playwright/src/common/fixtures.ts +++ b/packages/playwright/src/common/fixtures.ts @@ -235,7 +235,7 @@ export function fixtureParameterNames(fn: Function | any, location: Location, on return fn[signatureSymbol]; } -export function inheritFixutreNames(from: Function, to: Function) { +export function inheritFixtureNames(from: Function, to: Function) { (to as any)[signatureSymbol] = (from as any)[signatureSymbol]; } diff --git a/packages/playwright/src/matchers/toMatchSnapshot.ts b/packages/playwright/src/matchers/toMatchSnapshot.ts index ca7b38dfc5..83d20d22aa 100644 --- a/packages/playwright/src/matchers/toMatchSnapshot.ts +++ b/packages/playwright/src/matchers/toMatchSnapshot.ts @@ -130,7 +130,7 @@ class SnapshotHelper { ++snapshotNames.anonymousSnapshotIndex, ].join(' '); inputPathSegments = [sanitizeForFilePath(trimLongString(fullTitleWithoutSpec)) + '.' + anonymousSnapshotExtension]; - // Trim the output file paths more aggresively to avoid hitting Windows filesystem limits. + // Trim the output file paths more aggressively to avoid hitting Windows filesystem limits. this.outputBaseName = sanitizeForFilePath(trimLongString(fullTitleWithoutSpec, windowsFilesystemFriendlyLength)) + '.' + anonymousSnapshotExtension; } else { // We intentionally do not sanitize user-provided array of segments, but for backwards diff --git a/packages/playwright/src/reporters/merge.ts b/packages/playwright/src/reporters/merge.ts index 90eb22f1a7..17272a90d8 100644 --- a/packages/playwright/src/reporters/merge.ts +++ b/packages/playwright/src/reporters/merge.ts @@ -139,7 +139,7 @@ async function extractAndParseReports(dir: string, shardFiles: string[], interna fileName = reportNames.makeUnique(fileName); let parsedEvents = parseCommonEvents(content); // Passing reviver to JSON.parse doesn't work, as the original strings - // keep beeing used. To work around that we traverse the parsed events + // keep being used. To work around that we traverse the parsed events // as a post-processing step. internalizer.traverse(parsedEvents); const metadata = findMetadata(parsedEvents, file); diff --git a/packages/playwright/src/worker/fixtureRunner.ts b/packages/playwright/src/worker/fixtureRunner.ts index f425f1cd3e..8832acf8e2 100644 --- a/packages/playwright/src/worker/fixtureRunner.ts +++ b/packages/playwright/src/worker/fixtureRunner.ts @@ -83,7 +83,7 @@ class Fixture { this.failed = true; return; } - // Fixture teardown is root => leafs, when we need to teardown a fixture, + // Fixture teardown is root => leaves, when we need to teardown a fixture, // it recursively tears down its usages first. dep._usages.add(this); // Don't forget to decrement all usages when fixture goes. diff --git a/packages/playwright/src/worker/workerMain.ts b/packages/playwright/src/worker/workerMain.ts index 20c7feca6a..9ae9a86207 100644 --- a/packages/playwright/src/worker/workerMain.ts +++ b/packages/playwright/src/worker/workerMain.ts @@ -30,7 +30,7 @@ import { applyRepeatEachIndex, bindFileSuiteToProject, filterTestsRemoveEmptySui import { PoolBuilder } from '../common/poolBuilder'; import type { TestInfoError } from '../../types/test'; import type { Location } from '../../types/testReporter'; -import { inheritFixutreNames } from '../common/fixtures'; +import { inheritFixtureNames } from '../common/fixtures'; import { type TimeSlot, TimeoutManagerError } from './timeoutManager'; export class WorkerMain extends ProcessRunner { @@ -490,7 +490,7 @@ export class WorkerMain extends ProcessRunner { const result = await modifier.fn(fixtures); testInfo[modifier.type](!!result, modifier.description); }; - inheritFixutreNames(modifier.fn, fn); + inheritFixtureNames(modifier.fn, fn); runnables.push({ title: `${modifier.type} modifier`, location: modifier.location, diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 2440fbe556..9e050e2901 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -4233,7 +4233,7 @@ export interface TestType { expect(messages).toEqual(['hello']); }); -test('emit a falltrough event when the button is double clicked', async ({ mount }) => { +test('emit a fallthrough event when the button is double clicked', async ({ mount }) => { const messages: string[] = []; const component = await mount(Button, { props: { diff --git a/tests/components/ct-vue-cli/tests/events/events.spec.tsx b/tests/components/ct-vue-cli/tests/events/events.spec.tsx index 1534b6af11..3fddb9fb44 100644 --- a/tests/components/ct-vue-cli/tests/events/events.spec.tsx +++ b/tests/components/ct-vue-cli/tests/events/events.spec.tsx @@ -16,7 +16,7 @@ test('emit an submit event when the button is clicked', async ({ mount }) => { expect(messages).toEqual(['hello']); }); -test('emit a falltrough event when the button is double clicked', async ({ mount }) => { +test('emit a fallthrough event when the button is double clicked', async ({ mount }) => { const messages: string[] = []; const component = await mount(