Fix typos

This commit is contained in:
Viktor Szépe 2024-05-03 11:05:40 +00:00
parent d5b387159a
commit c501c44312
47 changed files with 92 additions and 92 deletions

View file

@ -106,7 +106,7 @@ function initialize(browsingContext, docShell, actor) {
}, },
ensurePermissions() { ensurePermissions() {
// noop, just a rountrip. // noop, just a roundtrip.
}, },
hasFailedToOverrideTimezone() { hasFailedToOverrideTimezone() {

View file

@ -318,7 +318,7 @@ class PageHandler {
const rect = new DOMRect(clip.x, clip.y, clip.width, clip.height); const rect = new DOMRect(clip.x, clip.y, clip.width, clip.height);
const browsingContext = this._pageTarget.linkedBrowser().browsingContext; const browsingContext = this._pageTarget.linkedBrowser().browsingContext;
// `win.devicePixelRatio` returns a non-overriden value to priveleged code. // `win.devicePixelRatio` returns a non-overridden value to privileged code.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1761032 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1761032
// See https://phabricator.services.mozilla.com/D141323 // See https://phabricator.services.mozilla.com/D141323
const devicePixelRatio = browsingContext.overrideDPPX || this._pageTarget._window.devicePixelRatio; const devicePixelRatio = browsingContext.overrideDPPX || this._pageTarget._window.devicePixelRatio;

View file

@ -1248,7 +1248,7 @@ index 11ca350f483458ba11f0ee170ce38e9785e8c70f..6bb310f6e96239388b4c92bd7bdf2d69
+ ScrollAxis(WhereToScroll::Center, WhenToScroll::IfNotFullyVisible), + ScrollAxis(WhereToScroll::Center, WhenToScroll::IfNotFullyVisible),
+ ScrollFlags::ScrollOverflowHidden); + ScrollFlags::ScrollOverflowHidden);
+ // If a _visual_ scroll update is pending, cancel it; otherwise, it will + // If a _visual_ scroll update is pending, cancel it; otherwise, it will
+ // clobber next scroll (e.g. subsequent window.scrollTo(0, 0) wlll break). + // clobber next scroll (e.g. subsequent window.scrollTo(0, 0) will break).
+ if (presShell->GetPendingVisualScrollUpdate()) { + if (presShell->GetPendingVisualScrollUpdate()) {
+ presShell->AcknowledgePendingVisualScrollUpdate(); + presShell->AcknowledgePendingVisualScrollUpdate();
+ presShell->ClearPendingVisualScrollUpdate(); + presShell->ClearPendingVisualScrollUpdate();
@ -2722,11 +2722,11 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e
+ nsCOMPtr<nsIFile> fileToUse; + nsCOMPtr<nsIFile> fileToUse;
+ rv = interceptor->InterceptDownloadRequest(this, request, mBrowsingContext, getter_AddRefs(fileToUse), &isIntercepted); + rv = interceptor->InterceptDownloadRequest(this, request, mBrowsingContext, getter_AddRefs(fileToUse), &isIntercepted);
+ if (!NS_SUCCEEDED(rv)) { + if (!NS_SUCCEEDED(rv)) {
+ LOG((" failed to call nsIDowloadInterceptor.interceptDownloadRequest")); + LOG((" failed to call nsIDownloadInterceptor.interceptDownloadRequest"));
+ return rv; + return rv;
+ } + }
+ if (isIntercepted) { + if (isIntercepted) {
+ LOG((" request interceped by nsIDowloadInterceptor")); + LOG((" request interceped by nsIDownloadInterceptor"));
+ if (fileToUse) { + if (fileToUse) {
+ mTempFile = fileToUse; + mTempFile = fileToUse;
+ rv = mTempFile->GetLeafName(mTempLeafName); + rv = mTempFile->GetLeafName(mTempLeafName);
@ -2768,7 +2768,7 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e
+ if (interceptor) { + if (interceptor) {
+ nsCString noError; + nsCString noError;
+ nsresult rv = interceptor->OnDownloadComplete(this, noError); + nsresult rv = interceptor->OnDownloadComplete(this, noError);
+ MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed to call nsIDowloadInterceptor.OnDownloadComplete"); + MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed to call nsIDownloadInterceptor.OnDownloadComplete");
+ Unused << rv; + Unused << rv;
+ } + }
+ } + }
@ -2785,7 +2785,7 @@ index 4573e28470c5112f5ac2c5dd53e7a9d1ceedb943..b53b86d8e39f1de4b0d0f1a8d5d7295e
+ nsCString errorName; + nsCString errorName;
+ GetErrorName(aReason, errorName); + GetErrorName(aReason, errorName);
+ nsresult rv = interceptor->OnDownloadComplete(this, errorName); + nsresult rv = interceptor->OnDownloadComplete(this, errorName);
+ MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed notify nsIDowloadInterceptor about cancel"); + MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed notify nsIDownloadInterceptor about cancel");
+ Unused << rv; + Unused << rv;
+ } + }
+ +
@ -2978,7 +2978,7 @@ index e4bdf715e2fb899e97a5bfeb2e147127460d6047..3554f919480278b7353617481c7ce805
!aEvent.IsShift() !aEvent.IsShift()
? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:)) ? ToObjcSelectorPtr(@selector(moveToBeginningOfDocument:))
: ToObjcSelectorPtr( : ToObjcSelectorPtr(
- @selector(moveToBegginingOfDocumentAndModifySelection:)), - @selector(moveToBeginningOfDocumentAndModifySelection:)),
+ @selector(moveToBeginningOfDocumentAndModifySelection:)), + @selector(moveToBeginningOfDocumentAndModifySelection:)),
aCommands); aCommands);
break; break;

View file

@ -33,11 +33,11 @@ class Dialog {
public: public:
bool run(HINSTANCE hInst, HWND hwnd, int dialogId) bool run(HINSTANCE hInst, HWND hwnd, int dialogId)
{ {
auto result = DialogBoxParam(hInst, MAKEINTRESOURCE(dialogId), hwnd, doalogProc, reinterpret_cast<LPARAM>(this)); auto result = DialogBoxParam(hInst, MAKEINTRESOURCE(dialogId), hwnd, dialogProc, reinterpret_cast<LPARAM>(this));
return (result > 0); return (result > 0);
} }
static INT_PTR CALLBACK doalogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) static INT_PTR CALLBACK dialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{ {
if (message == WM_INITDIALOG) if (message == WM_INITDIALOG)
SetWindowLongPtr(hDlg, DWLP_USER, lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam);

View file

@ -910,10 +910,10 @@ await expect(
assertThat(page.getByText("Welcome")).isVisible(); assertThat(page.getByText("Welcome")).isVisible();
// At least one item in the list is visible. // 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. // At least one of the two elements is visible, possibly both.
asserThat( assertThat(
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign in")) page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign in"))
.or(page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign up"))) .or(page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign up")))
.first() .first()

View file

@ -571,7 +571,7 @@ Whether to emulate network being offline. Defaults to `false`. Learn more about
- `username` <[string]> - `username` <[string]>
- `password` <[string]> - `password` <[string]>
- `origin` ?<[string]> Restrain sending http credentials on specific origin (scheme://host:port). - `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). 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. 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 * since: v1.41
- `behavior` <[UnrouteBehavior]<"wait"|"ignoreErrors"|"default">> - `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 * `'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 * `'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 * `'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers after unrouting are silently caught

View file

@ -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. After performing authentication and closing the browser, `auth.json` will contain the storage state which you can then reuse in your tests.
<img width="1394" alt="login to Github screen" src="https://user-images.githubusercontent.com/13063165/220561688-04b2b984-4ba6-4446-8b0a-8058876e2a02.png" /> <img width="1394" alt="login to GitHub screen" src="https://user-images.githubusercontent.com/13063165/220561688-04b2b984-4ba6-4446-8b0a-8058876e2a02.png" />
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. 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.

View file

@ -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" ```js title="example.spec.ts"
test.afterEach('Status check', async ({ page }) => { test.afterEach('Status check', async ({ page }) => {

View file

@ -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.| | `--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.| | `--forbid-only` | Whether to disallow `test.only`. Useful on CI.|
| `--global-timeout <number>` | Total timeout for the whole test run in milliseconds. By default, there is no global timeout. Learn more about [various timeouts](./test-timeouts.md).| | `--global-timeout <number>` | 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 <grep>` or `--grep <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). | | `-g <grep>` or `--grep <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 <grep>` | 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).| | `--grep-invert <grep>` | 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. | | `--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. | | `--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.| | `--last-failed` | Only re-run the failures.|

View file

@ -183,7 +183,7 @@ export const test = baseTest.extend<{}, { dbUserName: string }>({
dbUserName: [async ({ }, use) => { dbUserName: [async ({ }, use) => {
// Use workerIndex as a unique identifier for each worker. // Use workerIndex as a unique identifier for each worker.
const userName = `user-${test.info().workerIndex}`; const userName = `user-${test.info().workerIndex}`;
// Inialize user in the database. // Initialize user in the database.
await createUserInTestDatabase(userName); await createUserInTestDatabase(userName);
await use(userName); await use(userName);
// Clean up after the tests are done. // Clean up after the tests are done.

View file

@ -515,7 +515,7 @@ class FrameSession {
// Note: frames might be removed before we send these. // Note: frames might be removed before we send these.
this._client._sendMayFail('Page.createIsolatedWorld', { this._client._sendMayFail('Page.createIsolatedWorld', {
frameId: frame._id, frameId: frame._id,
grantUniveralAccess: true, grantUniversalAccess: true,
worldName: UTILITY_WORLD_NAME, worldName: UTILITY_WORLD_NAME,
}); });
for (const binding of this._crPage._browserContext._pageBindings.values()) for (const binding of this._crPage._browserContext._pageBindings.values())
@ -686,7 +686,7 @@ class FrameSession {
return; return;
} }
if (reason === 'swap') { 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. // Page.frameDetached arrives before Target.attachedToTarget.
// We should keep the frame in the tree, and it will be used for the new target. // We should keep the frame in the tree, and it will be used for the new target.
const frame = this._page._frameManager.frame(frameId); const frame = this._page._frameManager.frame(frameId);

View file

@ -349,7 +349,7 @@ export class DispatcherConnection {
} }
} }
response.error = serializeError(e); 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; callMetadata.error = response.error;
} finally { } finally {
callMetadata.endTime = monotonicTime(); callMetadata.endTime = monotonicTime();

View file

@ -75,7 +75,7 @@ export class JSHandleDispatcher extends Dispatcher<js.JSHandle, channels.JSHandl
} }
// Generic channel parser converts guids to JSHandleDispatchers, // Generic channel parser converts guids to JSHandleDispatchers,
// and this function takes care of coverting them into underlying JSHandles. // and this function takes care of converting them into underlying JSHandles.
export function parseArgument(arg: channels.SerializedArgument): any { export function parseArgument(arg: channels.SerializedArgument): any {
return parseSerializedValue(arg.value, arg.handles.map(a => (a as JSHandleDispatcher)._object)); return parseSerializedValue(arg.value, arg.handles.map(a => (a as JSHandleDispatcher)._object));
} }

View file

@ -76,7 +76,7 @@ export type NavigationEvent = {
// Error for cross-document navigations if any. When error is present, // Error for cross-document navigations if any. When error is present,
// the navigation did not commit. // the navigation did not commit.
error?: Error, 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; isPublic?: boolean;
}; };

View file

@ -351,7 +351,7 @@ export class HarTracer {
}); });
this._addBarrier(page || request.serviceWorker(), promise); 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(); const timing = response.timing();
harEntry.timings.receive = response.request()._responseEndTiming !== -1 ? helper.millisToRoundishMillis(response.request()._responseEndTiming - timing.responseStart) : -1; harEntry.timings.receive = response.request()._responseEndTiming !== -1 ? helper.millisToRoundishMillis(response.request()._responseEndTiming - timing.responseStart) : -1;
this._computeHarEntryTotalTime(harEntry); this._computeHarEntryTotalTime(harEntry);

View file

@ -625,7 +625,7 @@ function getTextAlternativeInternal(element: Element, options: AccessibleNameOpt
if (trimFlatString(title)) if (trimFlatString(title))
return title; return title;
// SPEC DIFFERENCE. // 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'; return 'Submit';
} }

View file

@ -282,7 +282,7 @@ function buildLayoutClosure(layout: keyboardLayout.KeyboardLayout): Map<string,
shiftedDescription.keyCode = definition.shiftKeyCode; shiftedDescription.keyCode = definition.shiftKeyCode;
} }
// Map from code: Digit3 -> { ... descrption, shifted } // Map from code: Digit3 -> { ... description, shifted }
result.set(code, { ...description, shifted: shiftedDescription }); result.set(code, { ...description, shifted: shiftedDescription });
// Map from aliases: Shift -> non-shiftable definition // Map from aliases: Shift -> non-shiftable definition

View file

@ -4390,7 +4390,7 @@ export interface Page {
*/ */
unrouteAll(options?: { 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 * - `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may
* result in unhandled error * result in unhandled error
* - `'wait'` - wait for current handler calls (if any) to finish * - `'wait'` - wait for current handler calls (if any) to finish
@ -8827,7 +8827,7 @@ export interface BrowserContext {
*/ */
unrouteAll(options?: { 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 * - `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may
* result in unhandled error * result in unhandled error
* - `'wait'` - wait for current handler calls (if any) to finish * - `'wait'` - wait for current handler calls (if any) to finish
@ -13378,7 +13378,7 @@ export interface BrowserType<Unused = {}> {
origin?: string; 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 * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent
* from the browser. * from the browser.
*/ */
@ -14901,7 +14901,7 @@ export interface AndroidDevice {
origin?: string; 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 * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent
* from the browser. * from the browser.
*/ */
@ -15632,7 +15632,7 @@ export interface APIRequest {
origin?: string; 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 * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent
* from the browser. * from the browser.
*/ */
@ -16783,7 +16783,7 @@ export interface Browser extends EventEmitter {
origin?: string; 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 * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent
* from the browser. * from the browser.
*/ */
@ -17677,7 +17677,7 @@ export interface Electron {
origin?: string; 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 * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent
* from the browser. * from the browser.
*/ */
@ -20344,7 +20344,7 @@ export interface HTTPCredentials {
origin?: string; 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 * 401 (Unauthorized) response with `WWW-Authenticate` header is received. This option does not affect requests sent
* from the browser. * from the browser.
*/ */

View file

@ -61,7 +61,7 @@ export async function incorporateCompilationCache() {
if (!loaderChannel) if (!loaderChannel)
return; return;
// This is needed to gather dependency information from the esm loader // 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. // this information proactively during load, but gather it at the end.
const result = await loaderChannel.send('getCompilationCache', {}); const result = await loaderChannel.send('getCompilationCache', {});
addToCompilationCache(result.cache); addToCompilationCache(result.cache);

View file

@ -235,7 +235,7 @@ export function fixtureParameterNames(fn: Function | any, location: Location, on
return fn[signatureSymbol]; 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]; (to as any)[signatureSymbol] = (from as any)[signatureSymbol];
} }

View file

@ -130,7 +130,7 @@ class SnapshotHelper {
++snapshotNames.anonymousSnapshotIndex, ++snapshotNames.anonymousSnapshotIndex,
].join(' '); ].join(' ');
inputPathSegments = [sanitizeForFilePath(trimLongString(fullTitleWithoutSpec)) + '.' + anonymousSnapshotExtension]; 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; this.outputBaseName = sanitizeForFilePath(trimLongString(fullTitleWithoutSpec, windowsFilesystemFriendlyLength)) + '.' + anonymousSnapshotExtension;
} else { } else {
// We intentionally do not sanitize user-provided array of segments, but for backwards // We intentionally do not sanitize user-provided array of segments, but for backwards

View file

@ -139,7 +139,7 @@ async function extractAndParseReports(dir: string, shardFiles: string[], interna
fileName = reportNames.makeUnique(fileName); fileName = reportNames.makeUnique(fileName);
let parsedEvents = parseCommonEvents(content); let parsedEvents = parseCommonEvents(content);
// Passing reviver to JSON.parse doesn't work, as the original strings // 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. // as a post-processing step.
internalizer.traverse(parsedEvents); internalizer.traverse(parsedEvents);
const metadata = findMetadata(parsedEvents, file); const metadata = findMetadata(parsedEvents, file);

View file

@ -83,7 +83,7 @@ class Fixture {
this.failed = true; this.failed = true;
return; 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. // it recursively tears down its usages first.
dep._usages.add(this); dep._usages.add(this);
// Don't forget to decrement all usages when fixture goes. // Don't forget to decrement all usages when fixture goes.

View file

@ -30,7 +30,7 @@ import { applyRepeatEachIndex, bindFileSuiteToProject, filterTestsRemoveEmptySui
import { PoolBuilder } from '../common/poolBuilder'; import { PoolBuilder } from '../common/poolBuilder';
import type { TestInfoError } from '../../types/test'; import type { TestInfoError } from '../../types/test';
import type { Location } from '../../types/testReporter'; import type { Location } from '../../types/testReporter';
import { inheritFixutreNames } from '../common/fixtures'; import { inheritFixtureNames } from '../common/fixtures';
import { type TimeSlot, TimeoutManagerError } from './timeoutManager'; import { type TimeSlot, TimeoutManagerError } from './timeoutManager';
export class WorkerMain extends ProcessRunner { export class WorkerMain extends ProcessRunner {
@ -490,7 +490,7 @@ export class WorkerMain extends ProcessRunner {
const result = await modifier.fn(fixtures); const result = await modifier.fn(fixtures);
testInfo[modifier.type](!!result, modifier.description); testInfo[modifier.type](!!result, modifier.description);
}; };
inheritFixutreNames(modifier.fn, fn); inheritFixtureNames(modifier.fn, fn);
runnables.push({ runnables.push({
title: `${modifier.type} modifier`, title: `${modifier.type} modifier`,
location: modifier.location, location: modifier.location,

View file

@ -4233,7 +4233,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* }); * });
* ``` * ```
* *
* Alternatively, you can delcare a hook **with a title**. * Alternatively, you can declare a hook **with a title**.
* *
* ```js * ```js
* // example.spec.ts * // example.spec.ts
@ -4283,7 +4283,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* }); * });
* ``` * ```
* *
* Alternatively, you can delcare a hook **with a title**. * Alternatively, you can declare a hook **with a title**.
* *
* ```js * ```js
* // example.spec.ts * // example.spec.ts

View file

@ -157,15 +157,15 @@
<h2>Name computation precedence tests</h2> <h2>Name computation precedence tests</h2>
<!-- Name computation: https://w3c.github.io/accname/#computation-steps --> <!-- Name computation: https://w3c.github.io/accname/#computation-steps -->
<!-- Step 2A: Hidden Not Referenced supercedes 2D: AriaLabel, also see wpt/accname/name/comp_hidden_not_referenced.html --> <!-- Step 2A: Hidden Not Referenced supersedes 2D: AriaLabel, also see wpt/accname/name/comp_hidden_not_referenced.html -->
<button aria-labelledby="span1" aria-label="foo" data-expectedlabel="label" data-testname="button's hidden referenced name (display:none) supercedes aria-label" class="ex"> <button aria-labelledby="span1" aria-label="foo" data-expectedlabel="label" data-testname="button's hidden referenced name (display:none) supersedes aria-label" class="ex">
<span id="span1" style="display:none;"> <span id="span1" style="display:none;">
<span id="span2" style="display:none;">label</span> <span id="span2" style="display:none;">label</span>
</span> </span>
x x
</button> </button>
<button aria-labelledby="span3" aria-label="foo" data-expectedlabel="label" data-testname="button's hidden referenced name (visibility:hidden) supercedes aria-label" class="ex"> <button aria-labelledby="span3" aria-label="foo" data-expectedlabel="label" data-testname="button's hidden referenced name (visibility:hidden) supersedes aria-label" class="ex">
<span id="span3" style="visibility:hidden;"> <span id="span3" style="visibility:hidden;">
<span id="span4" style="visibility:hidden;">label</span> <span id="span4" style="visibility:hidden;">label</span>
</span> </span>
@ -185,34 +185,34 @@ x
</button> </button>
</span> </span>
<!-- Step 2B: LabelledBy supercedes 2D: AriaLabel, also see wpt/accname/name/comp_labelledby.html --> <!-- Step 2B: LabelledBy supersedes 2D: AriaLabel, also see wpt/accname/name/comp_labelledby.html -->
<a href="#" aria-labelledby="span7" aria-label="foo" data-expectedlabel="label" data-testname="link's aria-labelledby name supercedes aria-label" class="ex">x</a> <a href="#" aria-labelledby="span7" aria-label="foo" data-expectedlabel="label" data-testname="link's aria-labelledby name supersedes aria-label" class="ex">x</a>
<span id="span7">label</span> <span id="span7">label</span>
<!-- Step 2C: Embedded Control labelling supercedes 2D: AriaLabel, see wpt/accname/name/comp_embedded_control.html --> <!-- Step 2C: Embedded Control labelling supersedes 2D: AriaLabel, see wpt/accname/name/comp_embedded_control.html -->
<!-- Step 2E: Host Language Label is superceded by 2D: AriaLabel, also see wpt/accname/name/comp_host_language_label.html --> <!-- Step 2E: Host Language Label is superseded by 2D: AriaLabel, also see wpt/accname/name/comp_host_language_label.html -->
<img alt="alt" aria-label="foo" data-expectedlabel="foo" data-testname="img's aria-label supercedes alt attribute" class="ex" /> <img alt="alt" aria-label="foo" data-expectedlabel="foo" data-testname="img's aria-label supersedes alt attribute" class="ex" />
<svg aria-label="foo" data-expectedlabel="foo" data-testname="svg's aria-label supercedes title tag" class="ex"> <svg aria-label="foo" data-expectedlabel="foo" data-testname="svg's aria-label supersedes title tag" class="ex">
<circle cx="5" cy="5" r="4"> <circle cx="5" cy="5" r="4">
<title>circle</title> <title>circle</title>
</circle> </circle>
</svg> </svg>
<label for="input1">label</label> <label for="input1">label</label>
<input type="text" id="input1" aria-label="foo" data-expectedlabel="foo" data-testname="input with label for association is superceded by aria-label" class="ex" /> <input type="text" id="input1" aria-label="foo" data-expectedlabel="foo" data-testname="input with label for association is superseded by aria-label" class="ex" />
<!-- Step 2F: Name From Content is superceded by 2D: AriaLabel, also see wpt/accname/name/comp_name_from_content.html --> <!-- Step 2F: Name From Content is superseded by 2D: AriaLabel, also see wpt/accname/name/comp_name_from_content.html -->
<button aria-label="label" data-expectedlabel="label" data-testname="button name from contents is superceded by aria-label" class="ex">x</button> <button aria-label="label" data-expectedlabel="label" data-testname="button name from contents is superseded by aria-label" class="ex">x</button>
<!-- Step 2G: Text Node is superceded by 2D: AriaLabel, also see wpt/accname/name/comp_text_node.html --> <!-- Step 2G: Text Node is superseded by 2D: AriaLabel, also see wpt/accname/name/comp_text_node.html -->
<h1 aria-label="label" data-expectedlabel="label" data-testname="h1 text is superceded by aria-label" class="ex">x</h1> <h1 aria-label="label" data-expectedlabel="label" data-testname="h1 text is superseded by aria-label" class="ex">x</h1>
<!-- Step 2H: Recursive Name from Content, see wpt/accname/name/comp_name_from_content.html --> <!-- Step 2H: Recursive Name from Content, see wpt/accname/name/comp_name_from_content.html -->
<!-- Step 2I: Tooltip is superceded by 2D: AriaLabel, also see wpt/accname/name/comp_tooltip.html --> <!-- Step 2I: Tooltip is superseded by 2D: AriaLabel, also see wpt/accname/name/comp_tooltip.html -->
<button aria-label="label" title="foo" data-expectedlabel="label" data-testname="button with title is superceded by aria-label" class="ex">x</button> <button aria-label="label" title="foo" data-expectedlabel="label" data-testname="button with title is superseded by aria-label" class="ex">x</button>
<h2>Empty/whitespace aria-label tests</h2> <h2>Empty/whitespace aria-label tests</h2>
<!-- <!--

View file

@ -232,28 +232,28 @@
</a> </a>
</h3> </h3>
<!-- cross-referencial edge case--> <!-- cross-referential edge case-->
<h1>heading with link referencing image using aria-labelledby, that in turn references text element via aria-labelledby</h1> <h1>heading with link referencing image using aria-labelledby, that in turn references text element via aria-labelledby</h1>
<h3 data-expectedlabel="image link" data-testname="heading with link referencing image using aria-labelledby, that in turn references text element via aria-labelledby" class="ex"> <h3 data-expectedlabel="image link" data-testname="heading with link referencing image using aria-labelledby, that in turn references text element via aria-labelledby" class="ex">
<a href="#" aria-labelledby="nested_image_label3"> <a href="#" aria-labelledby="nested_image_label3">
<span class="note" id="crossref_link">link</span><!-- this text is skipped the first time around because of aria-labelledby on parent element --> <span class="note" id="crossref_link">link</span><!-- this text is skipped the first time around because of aria-labelledby on parent element -->
</a> </a>
<!-- but it's picked up again in inverse order b/c of cross-referencial aria-labelledby edge case --> <!-- but it's picked up again in inverse order b/c of cross-referential aria-labelledby edge case -->
<img id="nested_image_label_3" alt="image" aria-labelledby="crossref_link" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="> <img id="nested_image_label_3" alt="image" aria-labelledby="crossref_link" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">
</h3> </h3>
<!-- self-referencial edge case--> <!-- self-referential edge case-->
<h1>heading with link referencing image using aria-labelledby, that in turn references itself and another element via aria-labelledby</h1> <h1>heading with link referencing image using aria-labelledby, that in turn references itself and another element via aria-labelledby</h1>
<h3 data-expectedlabel="image link" data-testname="heading with link referencing image using aria-labelledby, that in turn references itself and another element via aria-labelledby" class="ex"> <h3 data-expectedlabel="image link" data-testname="heading with link referencing image using aria-labelledby, that in turn references itself and another element via aria-labelledby" class="ex">
<a href="#" aria-labelledby="nested_image_label4"> <a href="#" aria-labelledby="nested_image_label4">
<span class="note" id="crossref_link2">link</span><!-- this text is skipped the first time around because of aria-labelledby on parent element --> <span class="note" id="crossref_link2">link</span><!-- this text is skipped the first time around because of aria-labelledby on parent element -->
</a> </a>
<!-- but it's picked up again (after the self-referencial image alt) in inverse order b/c of cross-referencial aria-labelledby edge case --> <!-- but it's picked up again (after the self-referential image alt) in inverse order b/c of cross-referential aria-labelledby edge case -->
<img id="nested_image_label4" alt="image" aria-labelledby="nested_image_label4 crossref_link2" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="> <img id="nested_image_label4" alt="image" aria-labelledby="nested_image_label4 crossref_link2" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">
</h3> </h3>
<!-- Note: The following test is out of line with the spec, but matching two out of three implementations at the time of writing, and spec changes are expeected. --> <!-- Note: The following test is out of line with the spec, but matching two out of three implementations at the time of writing, and spec changes are expected. -->
<!-- See details in https://github.com/w3c/accname/issues/205 --> <!-- See details in https://github.com/w3c/accname/issues/205 -->
<!-- Final spec resolution will be addressed in AccName Whitespace Project: https://github.com/w3c/accname/projects/1#card-42288231 --> <!-- Final spec resolution will be addressed in AccName Whitespace Project: https://github.com/w3c/accname/projects/1#card-42288231 -->
<h1>simple w/ for each child (w/o spaces and display:inline)</h1> <h1>simple w/ for each child (w/o spaces and display:inline)</h1>

View file

@ -15,7 +15,7 @@ test('emit an submit event when the button is clicked', async ({ mount }) => {
expect(messages).toEqual(['hello']); 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 messages: string[] = [];
const component = await mount(Button, { const component = await mount(Button, {
props: { props: {

View file

@ -16,7 +16,7 @@ test('emit an submit event when the button is clicked', async ({ mount }) => {
expect(messages).toEqual(['hello']); 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 messages: string[] = [];
const component = await mount( const component = await mount(
<Button <Button

View file

@ -15,7 +15,7 @@ test('emit a submit event when the button is clicked', async ({ mount }) => {
expect(messages).toEqual(['hello']); 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 = []; const messages = [];
const component = await mount(Button, { const component = await mount(Button, {
props: { props: {

View file

@ -15,7 +15,7 @@ test('emit a submit event when the button is clicked', async ({ mount }) => {
expect(messages).toEqual(['hello']); 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 messages: string[] = [];
const component = await mount(Button, { const component = await mount(Button, {
props: { props: {

View file

@ -16,7 +16,7 @@ test('emit a submit event when the button is clicked', async ({ mount }) => {
expect(messages).toEqual(['hello']); 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 messages: string[] = [];
const component = await mount( const component = await mount(
<Button <Button

View file

@ -26,7 +26,7 @@ import ws from 'ws';
import zlib, { gzip } from 'zlib'; import zlib, { gzip } from 'zlib';
import { createHttpServer, createHttpsServer } from '../../../packages/playwright-core/lib/utils/network'; import { createHttpServer, createHttpsServer } from '../../../packages/playwright-core/lib/utils/network';
const fulfillSymbol = Symbol('fullfil callback'); const fulfillSymbol = Symbol('fulfil callback');
const rejectSymbol = Symbol('reject callback'); const rejectSymbol = Symbol('reject callback');
const gzipAsync = util.promisify(gzip.bind(zlib)); const gzipAsync = util.promisify(gzip.bind(zlib));
@ -288,8 +288,8 @@ export class TestServer {
} }
waitForWebSocketConnectionRequest() { waitForWebSocketConnectionRequest() {
return new Promise<http.IncomingMessage & { headers: http.IncomingHttpHeaders }>(fullfil => { return new Promise<http.IncomingMessage & { headers: http.IncomingHttpHeaders }>(fulfil => {
this._wsServer.once('connection', (ws, req) => fullfil(req)); this._wsServer.once('connection', (ws, req) => fulfil(req));
}); });
} }

View file

@ -28,7 +28,7 @@ const fs = require('fs');
recordVideo: { dir: __dirname, size: {width: 320, height: 240} }, recordVideo: { dir: __dirname, size: {width: 320, height: 240} },
}); });
await context.newPage(); await context.newPage();
// Wait fo 1 second to actually record something. // Wait for 1 second to actually record something.
await new Promise(x => setTimeout(x, 1000)); await new Promise(x => setTimeout(x, 1000));
await context.close(); await context.close();
await browser.close(); await browser.close();

View file

@ -363,7 +363,7 @@ it('should detect overlay from another shadow root', async ({ page, server }) =>
expect(error.message).toContain(`<div id="container2"></div> intercepts pointer events`); expect(error.message).toContain(`<div id="container2"></div> intercepts pointer events`);
}); });
it('should detect overlayed element in a transformed iframe', async ({ page }) => { it('should detect overlaid element in a transformed iframe', async ({ page }) => {
await page.setContent(` await page.setContent(`
<style> <style>
body, html, iframe { margin: 0; padding: 0; border: none; } body, html, iframe { margin: 0; padding: 0; border: none; }

View file

@ -462,7 +462,7 @@ await page1.GotoAsync("about:blank?foo");`);
expect(models.active).toBe('#checkbox'); expect(models.active).toBe('#checkbox');
}); });
test('should check input with chaning id', async ({ page, openRecorder }) => { test('should check input with chaining id', async ({ page, openRecorder }) => {
const recorder = await openRecorder(); const recorder = await openRecorder();
await recorder.setContentAndWait(`<input id="checkbox" type="checkbox" name="accept" onchange="checkbox.name = 'updated'"></input>`); await recorder.setContentAndWait(`<input id="checkbox" type="checkbox" name="accept" onchange="checkbox.name = 'updated'"></input>`);
await Promise.all([ await Promise.all([

View file

@ -218,7 +218,7 @@ it('should support locator.or', async ({ page }) => {
await expect(page.locator('div').or(page.locator('span'))).toHaveCount(2); await expect(page.locator('div').or(page.locator('span'))).toHaveCount(2);
await expect(page.locator('div').or(page.locator('span'))).toHaveText(['hello', 'world']); await expect(page.locator('div').or(page.locator('span'))).toHaveText(['hello', 'world']);
await expect(page.locator('span').or(page.locator('article')).or(page.locator('div'))).toHaveText(['hello', 'world']); await expect(page.locator('span').or(page.locator('article')).or(page.locator('div'))).toHaveText(['hello', 'world']);
await expect(page.locator('article').or(page.locator('someting'))).toHaveCount(0); await expect(page.locator('article').or(page.locator('something'))).toHaveCount(0);
await expect(page.locator('article').or(page.locator('div'))).toHaveText('hello'); await expect(page.locator('article').or(page.locator('div'))).toHaveText('hello');
await expect(page.locator('article').or(page.locator('span'))).toHaveText('world'); await expect(page.locator('article').or(page.locator('span'))).toHaveText('world');
await expect(page.locator('div').or(page.locator('article'))).toHaveText('hello'); await expect(page.locator('div').or(page.locator('article'))).toHaveText('hello');

View file

@ -981,7 +981,7 @@ it('should click in a transformed iframe', async ({ page }) => {
expect(await page.evaluate('window._clicked')).toBe(true); expect(await page.evaluate('window._clicked')).toBe(true);
}); });
it('should click a button that is overlayed by a permission popup', async ({ page, server }) => { it('should click a button that is overlaid by a permission popup', async ({ page, server }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23280' }); it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/23280' });
await page.setViewportSize({ width: 500, height: 500 }); await page.setViewportSize({ width: 500, height: 500 });
await page.goto(server.EMPTY_PAGE); await page.goto(server.EMPTY_PAGE);

View file

@ -84,7 +84,7 @@ it('should traverse only form elements', async function({ page, browserName, pla
await page.setContent(` await page.setContent(`
<input id="input-1"> <input id="input-1">
<button id="button">buttton</button> <button id="button">button</button>
<a href id="link">link</a> <a href id="link">link</a>
<input id="input-2"> <input id="input-2">
`); `);

View file

@ -596,7 +596,7 @@ it('should not fulfill with redirect status', async ({ page, server, browserName
'location': '/empty.html', 'location': '/empty.html',
} }
}); });
reject('fullfill didn\'t throw'); reject('fulfill didn\'t throw');
} catch (e) { } catch (e) {
fulfill(e); fulfill(e);
} }

View file

@ -25,7 +25,7 @@ test('should clear cache with type:module', async ({ runCLICommand }) => {
import { defineConfig } from '@playwright/test'; import { defineConfig } from '@playwright/test';
export default defineConfig({}); export default defineConfig({});
`, `,
'pacakge.json': ` 'package.json': `
{ "type": "module" } { "type": "module" }
`, `,
'a.spec.ts': ` 'a.spec.ts': `

View file

@ -881,7 +881,7 @@ test('should chain expect matchers and expose matcher utils', async ({ runInline
expect(result.exitCode).toBe(1); expect(result.exitCode).toBe(1);
}); });
test('should suppport toHaveAttribute without optional value', async ({ runTSC }) => { test('should support toHaveAttribute without optional value', async ({ runTSC }) => {
const result = await runTSC({ const result = await runTSC({
'a.spec.ts': ` 'a.spec.ts': `
import { test, expect as baseExpect } from '@playwright/test'; import { test, expect as baseExpect } from '@playwright/test';
@ -925,7 +925,7 @@ test('should support mergeExpects (TSC)', async ({ runTSC }) => {
await expect(page).toBeAGoodPage(123); await expect(page).toBeAGoodPage(123);
await expect(page).toBeABadPage('123'); await expect(page).toBeABadPage('123');
// @ts-expect-error // @ts-expect-error
await expect(page).toBeAMedicorePage(); await expect(page).toBeAMediocrePage();
// @ts-expect-error // @ts-expect-error
await expect(page).toBeABadPage(123); await expect(page).toBeABadPage(123);
// @ts-expect-error // @ts-expect-error

View file

@ -641,11 +641,11 @@ test('generate html with attachment urls', async ({ runInlineTest, mergeReports,
for (const entry of await fs.promises.readdir(htmlReportDir)) for (const entry of await fs.promises.readdir(htmlReportDir))
await fs.promises.cp(path.join(htmlReportDir, entry), path.join(reportDir, entry), { recursive: true }); await fs.promises.cp(path.join(htmlReportDir, entry), path.join(reportDir, entry), { recursive: true });
const oldSeveFile = server.serveFile; const oldServeFile = server.serveFile;
server.serveFile = async (req, res) => { server.serveFile = async (req, res) => {
const pathName = url.parse(req.url!).pathname!; const pathName = url.parse(req.url!).pathname!;
const filePath = path.join(reportDir, pathName.substring(1)); const filePath = path.join(reportDir, pathName.substring(1));
return oldSeveFile.call(server, req, res, filePath); return oldServeFile.call(server, req, res, filePath);
}; };
await page.goto(`${server.PREFIX}/index.html`); await page.goto(`${server.PREFIX}/index.html`);

View file

@ -162,7 +162,7 @@ test('should be included in testInfo', async ({ runInlineTest }, testInfo) => {
expect(result.exitCode).toBe(0); expect(result.exitCode).toBe(0);
}); });
test('should be included in testInfo if comming from describe', async ({ runInlineTest }, testInfo) => { test('should be included in testInfo if coming from describe', async ({ runInlineTest }, testInfo) => {
const result = await runInlineTest({ const result = await runInlineTest({
'a.test.ts': ` 'a.test.ts': `
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';

View file

@ -92,7 +92,7 @@ async function onrequest(
if (!success) return requestAuthorization(req, res); if (!success) return requestAuthorization(req, res);
} catch (_err: unknown) { } catch (_err: unknown) {
const err = _err as Error; const err = _err as Error;
// an error occured during login! // an error occurred during login!
res.writeHead(500); res.writeHead(500);
res.end((err.stack || err.message || err) + '\n'); res.end((err.stack || err.message || err) + '\n');
return; return;
@ -403,7 +403,7 @@ async function onconnect(
if (!success) return requestAuthorization(req, res); if (!success) return requestAuthorization(req, res);
} catch (_err) { } catch (_err) {
const err = _err as Error; const err = _err as Error;
// an error occured during login! // an error occurred during login!
res.writeHead(500); res.writeHead(500);
res.end((err.stack || err.message || err) + '\n'); res.end((err.stack || err.message || err) + '\n');
return; return;

View file

@ -184,9 +184,9 @@ class TypesGenerator {
} }
/** /**
* @param {string} overriddes * @param {string} overrides
*/ */
objectDefinitionsToString(overriddes) { objectDefinitionsToString(overrides) {
let definition; let definition;
const parts = []; const parts = [];
const internalWords = new Set(overriddes.split(/[^\w$]/g)); const internalWords = new Set(overriddes.split(/[^\w$]/g));

View file

@ -321,13 +321,13 @@ playwright.chromium.launch().then(async browser => {
console.log(await resultHandle.jsonValue()); console.log(await resultHandle.jsonValue());
await resultHandle.dispose(); await resultHandle.dispose();
// evaluteHandle with two different return types (JSHandle) // evaluateHandle with two different return types (JSHandle)
{ {
const handle = await page.evaluateHandle(() => '' as string | number); const handle = await page.evaluateHandle(() => '' as string | number);
const result = await handle.evaluate(value => value); const result = await handle.evaluate(value => value);
const assertion: AssertType<string | number, typeof result> = true; const assertion: AssertType<string | number, typeof result> = true;
} }
// evaluteHandle with two different return types (ElementHandle) // evaluateHandle with two different return types (ElementHandle)
{ {
const handle = await page.evaluateHandle(() => '' as any as HTMLInputElement | HTMLTextAreaElement); const handle = await page.evaluateHandle(() => '' as any as HTMLInputElement | HTMLTextAreaElement);
await handle.evaluate(element => element.value); await handle.evaluate(element => element.value);