Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix: address TypeScript 6.0 deprecations (#38558)
LukeAbby8914db58ad96
diff --git a/docs/src/test-typescript-js.md b/docs/src/test-typescript-js.mdindex 538f5a137e..8000d90f2e 100644--- a/docs/src/test-typescript-js.md+++ b/docs/src/test-typescript-js.md@@ -47,16 +47,15 @@ playwright.config.ts### tsconfig path mapping-Playwright supports [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) declared in the `tsconfig.json`. Make sure that `baseUrl` is also set.+Playwright supports [path mapping](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) declared in the `tsconfig.json`.Here is an example `tsconfig.json` that works with Playwright:```json title="tsconfig.json"{"compilerOptions": {- "baseUrl": ".","paths": {- "@myhelper/*": ["packages/myhelper/*"] // This mapping is relative to "baseUrl".+ "@myhelper/*": ["packages/myhelper/*"] // This mapping is relative to the tsconfig.}}}diff --git a/packages/html-reporter/tsconfig.json b/packages/html-reporter/tsconfig.jsonindex 95a13e918d..142ae8c993 100644--- a/packages/html-reporter/tsconfig.json+++ b/packages/html-reporter/tsconfig.json@@ -14,7 +14,6 @@"isolatedModules": true,"noEmit": true,"jsx": "react-jsx",- "baseUrl": ".","useUnknownInCatchVariables": false,"paths": {"@protocol/*": ["../protocol/src/*"],diff --git a/packages/playwright-core/src/server/chromium/protocol.d.ts b/packages/playwright-core/src/server/chromium/protocol.d.tsindex 1b6d71707a..576f492e4d 100644--- a/packages/playwright-core/src/server/chromium/protocol.d.ts+++ b/packages/playwright-core/src/server/chromium/protocol.d.ts@@ -1,7 +1,7 @@// This is generated from /utils/protocol-types-generator/index.jstype binary = string;-export module Protocol {- export module Accessibility {+export namespace Protocol {+ export namespace Accessibility {/*** Unique accessibility node identifier.*/@@ -341,7 +341,7 @@ including nodes that are ignored for accessibility.}}- export module Animation {+ export namespace Animation {/*** Animation instance.*/@@ -667,7 +667,7 @@ percentage [0 - 100] for scroll driven animations/*** Audits domain allows investigation of page violations and possible improvements.*/- export module Audits {+ export namespace Audits {/*** Information about a cookie that is affected by an inspector issue.*/@@ -1242,7 +1242,7 @@ using Audits.issueAdded event./*** Defines commands and events for Autofill.*/- export module Autofill {+ export namespace Autofill {export interface CreditCard {/*** 16-digit credit card number.@@ -1409,7 +1409,7 @@ If the field and related form cannot be autofilled, returns an error./*** Defines events for background web platform features.*/- export module BackgroundService {+ export namespace BackgroundService {/*** The Background Service that will be associated with the commands/events.Every Background Service operates independently, but they share the same@@ -1512,7 +1512,7 @@ events afterwards if enabled and recording.* This domain allows configuring virtual Bluetooth devices to testthe web-bluetooth API.*/- export module BluetoothEmulation {+ export namespace BluetoothEmulation {/*** Indicates the various states of Central.*/@@ -1797,7 +1797,7 @@ by |characteristicId|./*** The Browser domain defines methods and events for browser managing.*/- export module Browser {+ export namespace Browser {export type BrowserContextID = string;export type WindowID = number;/**@@ -2284,7 +2284,7 @@ CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM nocan also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events andsubsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.*/- export module CSS {+ export namespace CSS {/*** Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agentstylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via@@ -3870,7 +3870,7 @@ instrumentation).}}- export module CacheStorage {+ export namespace CacheStorage {/*** Unique identifier of the Cache object.*/@@ -4067,7 +4067,7 @@ is the count of all entries from this storage.* A domain for interacting with Cast, Presentation API, and Remote Playback APIfunctionalities.*/- export module Cast {+ export namespace Cast {export interface Sink {name: string;id: string;@@ -4156,7 +4156,7 @@ and never sends the same node twice. It is client's responsibility to collect inthe nodes that were sent to the client. Note that `iframe` owner elements will returncorresponding document elements as their child nodes.*/- export module DOM {+ export namespace DOM {/*** Unique DOM node identifier.*/@@ -5619,7 +5619,7 @@ popover if it was previously force-opened.* DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScriptexecution will stop on these operations as if there was a regular breakpoint set.*/- export module DOMDebugger {+ export namespace DOMDebugger {/*** DOM breakpoint type.*/@@ -5821,7 +5821,7 @@ EventTarget./*** This domain facilitates obtaining document snapshots with DOM, layout, and style information.*/- export module DOMSnapshot {+ export namespace DOMSnapshot {/*** A Node in the DOM tree.*/@@ -6359,7 +6359,7 @@ The final text color opacity is computed based on the opacity of all overlapping/*** Query and modify DOM storage.*/- export module DOMStorage {+ export namespace DOMStorage {export type SerializedStorageKey = string;/*** DOM Storage identifier.@@ -6442,7 +6442,7 @@ The final text color opacity is computed based on the opacity of all overlapping}}- export module DeviceAccess {+ export namespace DeviceAccess {/*** Device request id.*/@@ -6504,7 +6504,7 @@ selectPrompt or cancelPrompt command.}}- export module DeviceOrientation {+ export namespace DeviceOrientation {/**@@ -6538,7 +6538,7 @@ selectPrompt or cancelPrompt command./*** This domain emulates different environments for the page.*/- export module Emulation {+ export namespace Emulation {export interface SafeAreaInsets {/*** Overrides safe-area-inset-top.@@ -7435,7 +7435,7 @@ of size 100lvh.occurring in native code invoked from JavaScript. Once breakpoint is hit, it isreported through Debugger domain, similarly to regular breakpoints being hit.*/- export module EventBreakpoints {+ export namespace EventBreakpoints {/**@@ -7472,7 +7472,7 @@ reported through Debugger domain, similarly to regular breakpoints being hit./*** Defines commands and events for browser extensions.*/- export module Extensions {+ export namespace Extensions {/*** Storage areas.*/@@ -7591,7 +7591,7 @@ will be merged with existing values in the storage area./*** This domain allows interacting with the FedCM dialog.*/- export module FedCm {+ export namespace FedCm {/*** Whether this is a sign-up or sign-in action for this account, i.e.whether this account has ever been used to sign in to this RP before.@@ -7699,7 +7699,7 @@ a dialog even if one was recently dismissed by the user./*** A domain for letting clients substitute browser's network layer with client code.*/- export module Fetch {+ export namespace Fetch {/*** Unique request identifier.Note that this does not identify individual HTTP requests that are part of@@ -8070,7 +8070,7 @@ domain before body is received results in an undefined behavior.}}- export module FileSystem {+ export namespace FileSystem {export interface File {name: string;/**@@ -8121,7 +8121,7 @@ domain before body is received results in an undefined behavior./*** This domain provides experimental commands only supported in headless mode.*/- export module HeadlessExperimental {+ export namespace HeadlessExperimental {/*** Encoding options for a screenshot.*/@@ -8201,7 +8201,7 @@ display. Reported for diagnostic uses, may be removed in the future./*** Input/Output operations for streams produced by DevTools.*/- export module IO {+ export namespace IO {/*** This is either obtained from another method or specified as `blob:<uuid>` where`<uuid>` is an UUID of a Blob.@@ -8269,7 +8269,7 @@ following the last read). Some types of streams may only support sequential read}}- export module IndexedDB {+ export namespace IndexedDB {/*** Database with an array of object stores.*/@@ -8648,7 +8648,7 @@ Security origin.}}- export module Input {+ export namespace Input {export interface TouchPoint {/*** X coordinate of the event relative to the main frame's viewport in CSS pixels.@@ -9171,7 +9171,7 @@ for the preferred input type).}}- export module Inspector {+ export namespace Inspector {/*** Fired when remote debugging connection is about to be terminated. Contains detach reason.@@ -9211,7 +9211,7 @@ for the preferred input type).}}- export module LayerTree {+ export namespace LayerTree {/*** Unique Layer identifier.*/@@ -9508,7 +9508,7 @@ transform/scrolling purposes only./*** Provides access to log entries.*/- export module Log {+ export namespace Log {/*** Log entry.*/@@ -9624,7 +9624,7 @@ transform/scrolling purposes only./*** This domain allows detailed inspection of media elements.*/- export module Media {+ export namespace Media {/*** Players will get an ID that is unique within the agent context.*/@@ -9755,7 +9755,7 @@ event for each active player.}}- export module Memory {+ export namespace Memory {/*** Memory pressure level.*/@@ -9935,7 +9935,7 @@ collected since browser process startup.* Network domain allows tracking network activities of the page. It exposes information about http,file, data and other requests and responses, their headers, bodies, timing, etc.*/- export module Network {+ export namespace Network {/*** Resource type as it was perceived by the rendering engine.*/@@ -12597,7 +12597,7 @@ Page reload is required before the new cookie behavior will be observed/*** This domain provides various functionality related to drawing atop the inspected page.*/- export module Overlay {+ export namespace Overlay {/*** Configuration data for drawing the source order of an elements children.*/@@ -13423,7 +13423,7 @@ Backend then generates 'inspectNodeRequested' event upon element selection./*** This domain allows interacting with the browser to control PWAs.*/- export module PWA {+ export namespace PWA {/*** The following types are the replica ofhttps://crsrc.org/c/chrome/browser/web_applications/proto/web_app_os_integration_state.proto;drc=9910d3be894c8f142c977ba1023f30a656bc13fc;l=67@@ -13594,7 +13594,7 @@ supported yet./*** Actions and events related to the inspected page belong to the page domain.*/- export module Page {+ export namespace Page {/*** Unique frame identifier.*/@@ -15714,7 +15714,7 @@ components/optimization_guide/proto/features/common_quality_data.proto}}- export module Performance {+ export namespace Performance {/*** Run-time execution metric.*/@@ -15791,7 +15791,7 @@ this method while metrics collection is enabled returns an error.* Reporting of performance timeline events, as specified inhttps://w3c.github.io/performance-timeline/#dom-performanceobserver.*/- export module PerformanceTimeline {+ export namespace PerformanceTimeline {/*** See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl*/@@ -15880,7 +15880,7 @@ Note that not all types exposed to the web platform are currently supported.}}- export module Preload {+ export namespace Preload {/*** Unique id*/@@ -16072,7 +16072,7 @@ that is incompatible with prerender and has caused the cancellation of the attem}}- export module Security {+ export namespace Security {/*** An internal certificate ID value.*/@@ -16377,7 +16377,7 @@ be handled by the DevTools client and should be answered with `handleCertificate}}- export module ServiceWorker {+ export namespace ServiceWorker {export type RegistrationID = string;/*** ServiceWorker registration.@@ -16499,7 +16499,7 @@ For cached script it is the last time the cache entry was validated.}}- export module Storage {+ export namespace Storage {export type SerializedStorageKey = string;/*** Enum of possible storage types.@@ -17604,7 +17604,7 @@ party URL, only the first-party URL is returned in the array./*** The SystemInfo domain defines methods and events for querying low-level system information.*/- export module SystemInfo {+ export namespace SystemInfo {/*** Describes a single graphics processor (GPU).*/@@ -17802,7 +17802,7 @@ supported./*** Supports additional targets discovery and allows to attach to them.*/- export module Target {+ export namespace Target {export type TargetID = string;/*** Unique identifier of attached debugging session.@@ -18317,7 +18317,7 @@ and performance./*** The Tethering domain defines methods and events for browser port binding.*/- export module Tethering {+ export namespace Tethering {/*** Informs that port was successfully bound and got a specified connection id.@@ -18357,7 +18357,7 @@ and performance.}}- export module Tracing {+ export namespace Tracing {/*** Configuration for memory dump. Used only when "memory-infra" category is enabled.*/@@ -18575,7 +18575,7 @@ are ignored.* This domain allows inspection of Web Audio API.https://webaudio.github.io/web-audio-api/*/- export module WebAudio {+ export namespace WebAudio {/*** An unique ID for a graph object (AudioContext, AudioNode, AudioParam) in Web Audio API*/@@ -18812,7 +18812,7 @@ capacity and glitch may occur.* This domain allows configuring virtual authenticators to test the WebAuthnAPI.*/- export module WebAuthn {+ export namespace WebAuthn {export type AuthenticatorId = string;export type AuthenticatorProtocol = "u2f"|"ctap2";export type Ctap2Version = "ctap2_0"|"ctap2_1";@@ -19109,7 +19109,7 @@ https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties/*** This domain is deprecated - use Runtime or Log instead.*/- export module Console {+ export namespace Console {/*** Console message.*/@@ -19178,7 +19178,7 @@ https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties* Debugger domain exposes JavaScript debugging capabilities. It allows setting and removingbreakpoints, stepping through execution, exploring stack traces, etc.*/- export module Debugger {+ export namespace Debugger {/*** Breakpoint identifier.*/@@ -20205,7 +20205,7 @@ before next pause.}}- export module HeapProfiler {+ export namespace HeapProfiler {/*** Heap snapshot object id.*/@@ -20434,7 +20434,7 @@ Deprecated in favor of `exposeInternals`.}}- export module Profiler {+ export namespace Profiler {/*** Profile node. Holds callsite information, execution statistics and child nodes.*/@@ -20704,7 +20704,7 @@ and unique identifier that can be used for further object reference. Original obmaintained in memory unless they are either explicitly released or are released along with theother objects in their object group.*/- export module Runtime {+ export namespace Runtime {/*** Unique script identifier.*/@@ -21763,7 +21763,7 @@ Error was thrown./*** This domain is deprecated.*/- export module Schema {+ export namespace Schema {/*** Description of the protocol domain.*/diff --git a/packages/playwright-core/src/server/firefox/protocol.d.ts b/packages/playwright-core/src/server/firefox/protocol.d.tsindex 6511bead5e..1b0d25a2bf 100644--- a/packages/playwright-core/src/server/firefox/protocol.d.ts+++ b/packages/playwright-core/src/server/firefox/protocol.d.ts@@ -1,7 +1,7 @@// This is generated from /utils/protocol-types-generator/index.js-export module Protocol {+export namespace Protocol {- export module Browser {+ export namespace Browser {export type TargetInfo = {type: ("page");targetId: string;@@ -320,12 +320,12 @@ export module Protocol {};export type cancelDownloadReturnValue = void;}- export module Heap {+ export namespace Heap {export type collectGarbageParameters = {};export type collectGarbageReturnValue = void;}- export module Page {+ export namespace Page {export type DOMPoint = {x: number;y: number;@@ -732,7 +732,7 @@ export module Protocol {export type stopScreencastParameters = void;export type stopScreencastReturnValue = void;}- export module Runtime {+ export namespace Runtime {export type RemoteObject = {type?: ("object"|"function"|"undefined"|"string"|"number"|"boolean"|"symbol"|"bigint");subtype?: ("array"|"null"|"node"|"regexp"|"date"|"map"|"set"|"weakmap"|"weakset"|"error"|"proxy"|"promise"|"typedarray");@@ -862,7 +862,7 @@ export module Protocol {}[];};}- export module Network {+ export namespace Network {export type HTTPHeader = {name: string;value: string;diff --git a/packages/playwright-core/src/server/webkit/protocol.d.ts b/packages/playwright-core/src/server/webkit/protocol.d.tsindex 360561f893..fc5ff3360d 100644--- a/packages/playwright-core/src/server/webkit/protocol.d.ts+++ b/packages/playwright-core/src/server/webkit/protocol.d.ts@@ -1,10 +1,10 @@// This is generated from /utils/protocol-types-generator/index.jstype binary = string;-export module Protocol {+export namespace Protocol {/*** Domain for tracking/modifying Web Animations, as well as CSS (declarative) animations and transitions.*/- export module Animation {+ export namespace Animation {/*** Unique Web Animation identifier.*/@@ -200,7 +200,7 @@ export module Protocol {}}- export module Audit {+ export namespace Audit {/**@@ -249,7 +249,7 @@ export module Protocol {/*** The Browser domain contains commands and events related to getting information about the browser*/- export module Browser {+ export namespace Browser {/*** Unique extension identifier.*/@@ -300,7 +300,7 @@ export module Protocol {/*** CPUProfiler domain exposes cpu usage tracking.*/- export module CPUProfiler {+ export namespace CPUProfiler {/*** CPU usage for an individual thread.*/@@ -372,7 +372,7 @@ export module Protocol {/*** This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated <code>id</code> used in subsequent operations on the related object. Each object type has a specific <code>id</code> structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the <code>get*ForNode()</code> calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the <code>getAllStyleSheets()</code> method and subsequently load the required stylesheet contents using the <code>getStyleSheet[Text]()</code> methods.*/- export module CSS {+ export namespace CSS {export type StyleSheetId = string;/*** This object identifies a CSS style in a unique way.@@ -1095,7 +1095,7 @@ export module Protocol {/*** Canvas domain allows tracking of canvases that have an associated graphics context. Tracks canvases in the DOM and CSS canvases created with -webkit-canvas.*/- export module Canvas {+ export namespace Canvas {/*** Unique canvas identifier.*/@@ -1432,7 +1432,7 @@ export module Protocol {/*** Console domain defines methods and events for interaction with the JavaScript console. Console collects messages created by means of the <a href='http://getfirebug.com/wiki/index.php/Console_API'>JavaScript Console API</a>. One needs to enable this domain using <code>enable</code> command in order to start receiving the console messages. Browser collects messages issued while console domain is not enabled as well and reports them using <code>messageAdded</code> notification upon enabling.*/- export module Console {+ export namespace Console {/*** Channels for different types of log messages.*/@@ -1652,7 +1652,7 @@ export module Protocol {/*** This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an <code>id</code>. This <code>id</code> can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client.<p>Note that <code>iframe</code> owner elements will return corresponding document elements as their child nodes.</p>*/- export module DOM {+ export namespace DOM {/*** Unique DOM node identifier.*/@@ -3351,7 +3351,7 @@ might return multiple quads for inline nodes./*** DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.*/- export module DOMDebugger {+ export namespace DOMDebugger {/*** DOM breakpoint type.*/@@ -3479,7 +3479,7 @@ might return multiple quads for inline nodes./*** Query and modify DOM storage.*/- export module DOMStorage {+ export namespace DOMStorage {/*** DOM Storage identifier.*/@@ -3560,7 +3560,7 @@ might return multiple quads for inline nodes./*** Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.*/- export module Debugger {+ export namespace Debugger {/*** Breakpoint identifier.*/@@ -4323,7 +4323,7 @@ might return multiple quads for inline nodes./*** Actions and events related to alert boxes.*/- export module Dialog {+ export namespace Dialog {/*** Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.@@ -4374,7 +4374,7 @@ might return multiple quads for inline nodes.}}- export module Emulation {+ export namespace Emulation {/**@@ -4443,7 +4443,7 @@ might return multiple quads for inline nodes./*** Exposes generic types to be used by any domain.*/- export module GenericTypes {+ export namespace GenericTypes {/*** Search match in a resource.*/@@ -4464,7 +4464,7 @@ might return multiple quads for inline nodes./*** Heap domain exposes JavaScript heap attributes and capabilities.*/- export module Heap {+ export namespace Heap {/*** Information about a garbage collection.*/@@ -4596,7 +4596,7 @@ might return multiple quads for inline nodes.}}- export module IndexedDB {+ export namespace IndexedDB {/*** Database with an array of object stores.*/@@ -4850,7 +4850,7 @@ might return multiple quads for inline nodes.}}- export module Input {+ export namespace Input {/*** UTC time in seconds, counted from January 1, 1970.*/@@ -5050,7 +5050,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the}}- export module Inspector {+ export namespace Inspector {export type evaluateForTestInFrontendPayload = {script: string;@@ -5083,7 +5083,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the}}- export module LayerTree {+ export namespace LayerTree {/*** Unique RenderLayer identifier.*/@@ -5339,7 +5339,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Memory domain exposes page memory tracking.*/- export module Memory {+ export namespace Memory {export interface Event {timestamp: number;/**@@ -5420,7 +5420,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.*/- export module Network {+ export namespace Network {/*** Unique loader identifier.*/@@ -6344,7 +6344,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Actions and events related to the inspected page belong to the page domain.*/- export module Page {+ export namespace Page {/*** List of settings able to be overridden by WebInspector.*/@@ -7076,7 +7076,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the}}- export module Playwright {+ export namespace Playwright {/*** Id of Browser context.*/@@ -7557,7 +7557,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** General types used for recordings of actions performed in the inspected page.*/- export module Recording {+ export namespace Recording {/*** The type of the recording.*/@@ -7624,7 +7624,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.*/- export module Runtime {+ export namespace Runtime {/*** Unique object identifier.*/@@ -8430,7 +8430,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the}}- export module Screencast {+ export namespace Screencast {/*** Unique identifier of the screencast.*/@@ -8506,7 +8506,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Profiler domain exposes JavaScript evaluation timing and profiling.*/- export module ScriptProfiler {+ export namespace ScriptProfiler {export type EventType = "API"|"Microtask"|"Other";export interface Event {startTime: number;@@ -8600,7 +8600,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Security domain allows the frontend to query for information relating to the security of the page (e.g. HTTPS info, TLS info, user activity, etc.).*/- export module Security {+ export namespace Security {/*** Information about a SSL connection to display in the frontend.*/@@ -8638,7 +8638,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Actions and events related to the inspected service worker.*/- export module ServiceWorker {+ export namespace ServiceWorker {/*** ServiceWorker metadata and initial state.*/@@ -8666,7 +8666,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the}}- export module Target {+ export namespace Target {/*** Description of a target.*/@@ -8767,7 +8767,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the/*** Timeline provides its clients with instrumentation records that are generated during the page runtime. Timeline instrumentation can be started and stopped using corresponding commands. While timeline is started, it is generating timeline event records.*/- export module Timeline {+ export namespace Timeline {/*** Timeline record type.*/@@ -8882,7 +8882,7 @@ the top of the viewport and Y increases as it proceeds towards the bottom of the}}- export module Worker {+ export namespace Worker {export type workerCreatedPayload = {workerId: string;diff --git a/packages/playwright-core/types/protocol.d.ts b/packages/playwright-core/types/protocol.d.tsindex 1b6d71707a..576f492e4d 100644--- a/packages/playwright-core/types/protocol.d.ts+++ b/packages/playwright-core/types/protocol.d.ts@@ -1,7 +1,7 @@// This is generated from /utils/protocol-types-generator/index.jstype binary = string;-export module Protocol {- export module Accessibility {+export namespace Protocol {+ export namespace Accessibility {/*** Unique accessibility node identifier.*/@@ -341,7 +341,7 @@ including nodes that are ignored for accessibility.}}- export module Animation {+ export namespace Animation {/*** Animation instance.*/@@ -667,7 +667,7 @@ percentage [0 - 100] for scroll driven animations/*** Audits domain allows investigation of page violations and possible improvements.*/- export module Audits {+ export namespace Audits {/*** Information about a cookie that is affected by an inspector issue.*/@@ -1242,7 +1242,7 @@ using Audits.issueAdded event./*** Defines commands and events for Autofill.*/- export module Autofill {+ export namespace Autofill {export interface CreditCard {/*** 16-digit credit card number.@@ -1409,7 +1409,7 @@ If the field and related form cannot be autofilled, returns an error./*** Defines events for background web platform features.*/- export module BackgroundService {+ export namespace BackgroundService {/*** The Background Service that will be associated with the commands/events.Every Background Service operates independently, but they share the same@@ -1512,7 +1512,7 @@ events afterwards if enabled and recording.* This domain allows configuring virtual Bluetooth devices to testthe web-bluetooth API.*/- export module BluetoothEmulation {+ export namespace BluetoothEmulation {/*** Indicates the various states of Central.*/@@ -1797,7 +1797,7 @@ by |characteristicId|./*** The Browser domain defines methods and events for browser managing.*/- export module Browser {+ export namespace Browser {export type BrowserContextID = string;export type WindowID = number;/**@@ -2284,7 +2284,7 @@ CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM nocan also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events andsubsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.*/- export module CSS {+ export namespace CSS {/*** Stylesheet type: "injected" for stylesheets injected via extension, "user-agent" for user-agentstylesheets, "inspector" for stylesheets created by the inspector (i.e. those holding the "via@@ -3870,7 +3870,7 @@ instrumentation).}}- export module CacheStorage {+ export namespace CacheStorage {/*** Unique identifier of the Cache object.*/@@ -4067,7 +4067,7 @@ is the count of all entries from this storage.* A domain for interacting with Cast, Presentation API, and Remote Playback APIfunctionalities.*/- export module Cast {+ export namespace Cast {export interface Sink {name: string;id: string;@@ -4156,7 +4156,7 @@ and never sends the same node twice. It is client's responsibility to collect inthe nodes that were sent to the client. Note that `iframe` owner elements will returncorresponding document elements as their child nodes.*/- export module DOM {+ export namespace DOM {/*** Unique DOM node identifier.*/@@ -5619,7 +5619,7 @@ popover if it was previously force-opened.* DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScriptexecution will stop on these operations as if there was a regular breakpoint set.*/- export module DOMDebugger {+ export namespace DOMDebugger {/*** DOM breakpoint type.*/@@ -5821,7 +5821,7 @@ EventTarget./*** This domain facilitates obtaining document snapshots with DOM, layout, and style information.*/- export module DOMSnapshot {+ export namespace DOMSnapshot {/*** A Node in the DOM tree.*/@@ -6359,7 +6359,7 @@ The final text color opacity is computed based on the opacity of all overlapping/*** Query and modify DOM storage.*/- export module DOMStorage {+ export namespace DOMStorage {export type SerializedStorageKey = string;/*** DOM Storage identifier.@@ -6442,7 +6442,7 @@ The final text color opacity is computed based on the opacity of all overlapping}}- export module DeviceAccess {+ export namespace DeviceAccess {/*** Device request id.*/@@ -6504,7 +6504,7 @@ selectPrompt or cancelPrompt command.}}- export module DeviceOrientation {+ export namespace DeviceOrientation {/**@@ -6538,7 +6538,7 @@ selectPrompt or cancelPrompt command./*** This domain emulates different environments for the page.*/- export module Emulation {+ export namespace Emulation {export interface SafeAreaInsets {/*** Overrides safe-area-inset-top.@@ -7435,7 +7435,7 @@ of size 100lvh.occurring in native code invoked from JavaScript. Once breakpoint is hit, it isreported through Debugger domain, similarly to regular breakpoints being hit.*/- export module EventBreakpoints {+ export namespace EventBreakpoints {/**@@ -7472,7 +7472,7 @@ reported through Debugger domain, similarly to regular breakpoints being hit./*** Defines commands and events for browser extensions.*/- export module Extensions {+ export namespace Extensions {/*** Storage areas.*/@@ -7591,7 +7591,7 @@ will be merged with existing values in the storage area./*** This domain allows interacting with the FedCM dialog.*/- export module FedCm {+ export namespace FedCm {/*** Whether this is a sign-up or sign-in action for this account, i.e.whether this account has ever been used to sign in to this RP before.@@ -7699,7 +7699,7 @@ a dialog even if one was recently dismissed by the user./*** A domain for letting clients substitute browser's network layer with client code.*/- export module Fetch {+ export namespace Fetch {/*** Unique request identifier.Note that this does not identify individual HTTP requests that are part of@@ -8070,7 +8070,7 @@ domain before body is received results in an undefined behavior.}}- export module FileSystem {+ export namespace FileSystem {export interface File {name: string;/**@@ -8121,7 +8121,7 @@ domain before body is received results in an undefined behavior./*** This domain provides experimental commands only supported in headless mode.*/- export module HeadlessExperimental {+ export namespace HeadlessExperimental {/*** Encoding options for a screenshot.*/@@ -8201,7 +8201,7 @@ display. Reported for diagnostic uses, may be removed in the future./*** Input/Output operations for streams produced by DevTools.*/- export module IO {+ export namespace IO {/*** This is either obtained from another method or specified as `blob:<uuid>` where`<uuid>` is an UUID of a Blob.@@ -8269,7 +8269,7 @@ following the last read). Some types of streams may only support sequential read}}- export module IndexedDB {+ export namespace IndexedDB {/*** Database with an array of object stores.*/@@ -8648,7 +8648,7 @@ Security origin.}}- export module Input {+ export namespace Input {export interface TouchPoint {/*** X coordinate of the event relative to the main frame's viewport in CSS pixels.@@ -9171,7 +9171,7 @@ for the preferred input type).}}- export module Inspector {+ export namespace Inspector {/*** Fired when remote debugging connection is about to be terminated. Contains detach reason.@@ -9211,7 +9211,7 @@ for the preferred input type).}}- export module LayerTree {+ export namespace LayerTree {/*** Unique Layer identifier.*/@@ -9508,7 +9508,7 @@ transform/scrolling purposes only./*** Provides access to log entries.*/- export module Log {+ export namespace Log {/*** Log entry.*/@@ -9624,7 +9624,7 @@ transform/scrolling purposes only./*** This domain allows detailed inspection of media elements.*/- export module Media {+ export namespace Media {/*** Players will get an ID that is unique within the agent context.*/@@ -9755,7 +9755,7 @@ event for each active player.}}- export module Memory {+ export namespace Memory {/*** Memory pressure level.*/@@ -9935,7 +9935,7 @@ collected since browser process startup.* Network domain allows tracking network activities of the page. It exposes information about http,file, data and other requests and responses, their headers, bodies, timing, etc.*/- export module Network {+ export namespace Network {/*** Resource type as it was perceived by the rendering engine.*/@@ -12597,7 +12597,7 @@ Page reload is required before the new cookie behavior will be observed/*** This domain provides various functionality related to drawing atop the inspected page.*/- export module Overlay {+ export namespace Overlay {/*** Configuration data for drawing the source order of an elements children.*/@@ -13423,7 +13423,7 @@ Backend then generates 'inspectNodeRequested' event upon element selection./*** This domain allows interacting with the browser to control PWAs.*/- export module PWA {+ export namespace PWA {/*** The following types are the replica ofhttps://crsrc.org/c/chrome/browser/web_applications/proto/web_app_os_integration_state.proto;drc=9910d3be894c8f142c977ba1023f30a656bc13fc;l=67@@ -13594,7 +13594,7 @@ supported yet./*** Actions and events related to the inspected page belong to the page domain.*/- export module Page {+ export namespace Page {/*** Unique frame identifier.*/@@ -15714,7 +15714,7 @@ components/optimization_guide/proto/features/common_quality_data.proto}}- export module Performance {+ export namespace Performance {/*** Run-time execution metric.*/@@ -15791,7 +15791,7 @@ this method while metrics collection is enabled returns an error.* Reporting of performance timeline events, as specified inhttps://w3c.github.io/performance-timeline/#dom-performanceobserver.*/- export module PerformanceTimeline {+ export namespace PerformanceTimeline {/*** See https://github.com/WICG/LargestContentfulPaint and largest_contentful_paint.idl*/@@ -15880,7 +15880,7 @@ Note that not all types exposed to the web platform are currently supported.}}- export module Preload {+ export namespace Preload {/*** Unique id*/@@ -16072,7 +16072,7 @@ that is incompatible with prerender and has caused the cancellation of the attem}}- export module Security {+ export namespace Security {/*** An internal certificate ID value.*/@@ -16377,7 +16377,7 @@ be handled by the DevTools client and should be answered with `handleCertificate}}- export module ServiceWorker {+ export namespace ServiceWorker {export type RegistrationID = string;/*** ServiceWorker registration.@@ -16499,7 +16499,7 @@ For cached script it is the last time the cache entry was validated.}}- export module Storage {+ export namespace Storage {export type SerializedStorageKey = string;/*** Enum of possible storage types.@@ -17604,7 +17604,7 @@ party URL, only the first-party URL is returned in the array./*** The SystemInfo domain defines methods and events for querying low-level system information.*/- export module SystemInfo {+ export namespace SystemInfo {/*** Describes a single graphics processor (GPU).*/@@ -17802,7 +17802,7 @@ supported./*** Supports additional targets discovery and allows to attach to them.*/- export module Target {+ export namespace Target {export type TargetID = string;/*** Unique identifier of attached debugging session.@@ -18317,7 +18317,7 @@ and performance./*** The Tethering domain defines methods and events for browser port binding.*/- export module Tethering {+ export namespace Tethering {/*** Informs that port was successfully bound and got a specified connection id.@@ -18357,7 +18357,7 @@ and performance.}}- export module Tracing {+ export namespace Tracing {/*** Configuration for memory dump. Used only when "memory-infra" category is enabled.*/@@ -18575,7 +18575,7 @@ are ignored.* This domain allows inspection of Web Audio API.https://webaudio.github.io/web-audio-api/*/- export module WebAudio {+ export namespace WebAudio {/*** An unique ID for a graph object (AudioContext, AudioNode, AudioParam) in Web Audio API*/@@ -18812,7 +18812,7 @@ capacity and glitch may occur.* This domain allows configuring virtual authenticators to test the WebAuthnAPI.*/- export module WebAuthn {+ export namespace WebAuthn {export type AuthenticatorId = string;export type AuthenticatorProtocol = "u2f"|"ctap2";export type Ctap2Version = "ctap2_0"|"ctap2_1";@@ -19109,7 +19109,7 @@ https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties/*** This domain is deprecated - use Runtime or Log instead.*/- export module Console {+ export namespace Console {/*** Console message.*/@@ -19178,7 +19178,7 @@ https://w3c.github.io/webauthn/#sctn-automation-set-credential-properties* Debugger domain exposes JavaScript debugging capabilities. It allows setting and removingbreakpoints, stepping through execution, exploring stack traces, etc.*/- export module Debugger {+ export namespace Debugger {/*** Breakpoint identifier.*/@@ -20205,7 +20205,7 @@ before next pause.}}- export module HeapProfiler {+ export namespace HeapProfiler {/*** Heap snapshot object id.*/@@ -20434,7 +20434,7 @@ Deprecated in favor of `exposeInternals`.}}- export module Profiler {+ export namespace Profiler {/*** Profile node. Holds callsite information, execution statistics and child nodes.*/@@ -20704,7 +20704,7 @@ and unique identifier that can be used for further object reference. Original obmaintained in memory unless they are either explicitly released or are released along with theother objects in their object group.*/- export module Runtime {+ export namespace Runtime {/*** Unique script identifier.*/@@ -21763,7 +21763,7 @@ Error was thrown./*** This domain is deprecated.*/- export module Schema {+ export namespace Schema {/*** Description of the protocol domain.*/diff --git a/packages/playwright/src/common/validators.ts b/packages/playwright/src/common/validators.tsindex 4c955713c8..0a4befa1eb 100644--- a/packages/playwright/src/common/validators.ts+++ b/packages/playwright/src/common/validators.ts@@ -16,7 +16,7 @@import { zod } from 'playwright-core/lib/utilsBundle';-import type { TestAnnotation, TestDetailsAnnotation } from 'packages/playwright/types/test';+import type { TestAnnotation, TestDetailsAnnotation } from '../../types/test';import type { Location } from '../../types/testReporter';import type { ZodError } from 'zod';diff --git a/packages/recorder/tsconfig.json b/packages/recorder/tsconfig.jsonindex 4defa85f64..5674b1a325 100644--- a/packages/recorder/tsconfig.json+++ b/packages/recorder/tsconfig.json@@ -14,7 +14,6 @@"isolatedModules": true,"noEmit": true,"jsx": "react-jsx",- "baseUrl": ".","useUnknownInCatchVariables": false,"paths": {"@isomorphic/*": ["../playwright-core/src/utils/isomorphic/*"],diff --git a/packages/trace-viewer/tsconfig.json b/packages/trace-viewer/tsconfig.jsonindex f2303555a1..3705426109 100644--- a/packages/trace-viewer/tsconfig.json+++ b/packages/trace-viewer/tsconfig.json@@ -5,7 +5,6 @@"lib": ["DOM", "DOM.Iterable", "ESNext"],"allowJs": true,"skipLibCheck": false,- "esModuleInterop": false,"allowSyntheticDefaultImports": true,"strict": true,"module": "ESNext",@@ -14,7 +13,6 @@"isolatedModules": true,"noEmit": true,"jsx": "react-jsx",- "baseUrl": ".","paths": {"@injected/*": ["../injected/src/*"],"@isomorphic/*": ["../playwright-core/src/utils/isomorphic/*"],diff --git a/tsconfig.json b/tsconfig.jsonindex 1fb09a13a0..268c30e76b 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -3,7 +3,6 @@"target": "ES2019","module": "commonjs","lib": ["esnext", "dom", "DOM.Iterable"],- "baseUrl": ".","paths": {/*The following two serve different purposes:diff --git a/utils/protocol-types-generator/index.js b/utils/protocol-types-generator/index.jsindex 7686cb3b92..92aa40e350 100644--- a/utils/protocol-types-generator/index.js+++ b/utils/protocol-types-generator/index.js@@ -40,11 +40,11 @@ const conditionFilter = command => command.condition !== 'defined(WTF_PLATFORM_Ifunction jsonToTS(json) {return `// This is generated from /utils/protocol-types-generator/index.jstype binary = string;-export module Protocol {${json.domains.map(domain => `${domain.description ? `+export namespace Protocol {${json.domains.map(domain => `${domain.description ? `/*** ${domain.description}*/` : ''}- export module ${domain.domain} {${(domain.types || []).map(type => `${type.description ? `+ export namespace ${domain.domain} {${(domain.types || []).map(type => `${type.description ? `/*** ${type.description}*/` : ''}${type.properties ? `@@ -180,9 +180,9 @@ async function generateFirefoxProtocol(executablePath) {function firefoxJSONToTS(json) {const domains = Object.entries(json.domains);return `// This is generated from /utils/protocol-types-generator/index.js-export module Protocol {+export namespace Protocol {${domains.map(([domainName, domain]) => `- export module ${domainName} {${Object.entries(domain.types).map(([typeName, type]) => `+ export namespace ${domainName} {${Object.entries(domain.types).map(([typeName, type]) => `export type ${typeName} = ${firefoxTypeToString(type, ' ')};`).join('')}${(Object.entries(domain.events)).map(([eventName, event]) => `export type ${eventName}Payload = ${firefoxTypeToString(event)}`).join('')}${(Object.entries(domain.methods)).map(([commandName, command]) => `export type ${commandName}Parameters = ${firefoxTypeToString(command.params)};