diff --git a/.claude/skills/playwright-dev/trace_system_guide.md b/.claude/skills/playwright-dev/trace_system_guide.md index ef6345e0daac3..c8312b7523924 100644 --- a/.claude/skills/playwright-dev/trace_system_guide.md +++ b/.claude/skills/playwright-dev/trace_system_guide.md @@ -15,22 +15,20 @@ The Playwright trace system is a comprehensive recording and visualization frame ## 2. File Structure -### packages/trace/src/ - Trace Type Definitions -Located in `/home/pfeldman/code/playwright/packages/trace/src/` +### packages/isomorphic/trace/ - Trace Type Definitions **Key Files:** -- **trace.ts** - Core trace event type definitions -- **har.ts** - HTTP Archive format (network traffic) -- **snapshot.ts** - DOM snapshot data structures -- **DEPS.list** - Dependencies marker +- **trace.ts** - Current trace event and snapshot types; re-exports the latest version +- **versions/** - One file per trace format version, plus legacy formats kept for modernization +- **versions/har.ts** - HTTP Archive format (network traffic) **File List:** ``` -trace/src/ -├── trace.ts (183 lines) - Main trace event types -├── har.ts (189 lines) - HAR format types -├── snapshot.ts (62 lines) - Snapshot data structures -└── DEPS.list - Dependencies file +isomorphic/trace/ +├── trace.ts - Current trace event + snapshot types (re-export) +└── versions/ + ├── traceV*.ts - Per-version trace event types + └── har.ts - HAR format types ``` --- @@ -206,7 +204,7 @@ type ErrorTraceEvent = { --- -## 4. HAR Format (har.ts) +## 4. HAR Format (versions/har.ts) Follows HTTP Archive 1.2 specification. Key structure for network traffic: @@ -247,7 +245,7 @@ type Entry = { --- -## 5. Snapshot Format (snapshot.ts) +## 5. Snapshot Format (trace.ts) ### FrameSnapshot ```typescript @@ -915,9 +913,8 @@ Every action uses a unique `callId` to correlate: | File | Size | Purpose | |------|------|---------| -| `trace/src/trace.ts` | 183 lines | Trace event types | -| `trace/src/har.ts` | 189 lines | Network HAR types | -| `trace/src/snapshot.ts` | 62 lines | Snapshot types | +| `isomorphic/trace/trace.ts` | Trace event and snapshot types | +| `isomorphic/trace/versions/har.ts` | Network HAR types | | `playwright-core/.../tracing.ts` | 700+ lines | Recording engine | | `playwright-core/.../traceParser.ts` | 62 lines | ZIP backend | | `playwright-core/.../traceViewer.ts` | 288 lines | Viewer server | diff --git a/packages/isomorphic/trace/entries.ts b/packages/isomorphic/trace/entries.ts index cdba1834d1c52..87ce409850970 100644 --- a/packages/isomorphic/trace/entries.ts +++ b/packages/isomorphic/trace/entries.ts @@ -15,8 +15,7 @@ */ import type { Language } from '../locatorGenerators'; -import type { ResourceSnapshot } from '@trace/snapshot'; -import type * as trace from '@trace/trace'; +import type * as trace from './trace'; // *Entry structures are used to pass the trace between the sw and the page. @@ -35,7 +34,7 @@ export type ContextEntry = { title?: string; options: trace.BrowserContextEventOptions; pages: PageEntry[]; - resources: ResourceSnapshot[]; + resources: trace.ResourceSnapshot[]; actions: ActionEntry[]; screenshots: trace.ScreenshotTraceEvent[]; ariaSnapshots: trace.AriaSnapshotTraceEvent[]; diff --git a/packages/isomorphic/trace/snapshotRenderer.ts b/packages/isomorphic/trace/snapshotRenderer.ts index 0e2a96aef9d04..53b9a5249bd29 100644 --- a/packages/isomorphic/trace/snapshotRenderer.ts +++ b/packages/isomorphic/trace/snapshotRenderer.ts @@ -16,7 +16,7 @@ import { escapeHTMLAttribute, escapeHTML } from '../stringUtils'; -import type { FrameSnapshot, NodeNameAttributesChildNodesSnapshot, NodeSnapshot, RenderedFrameSnapshot, ResourceSnapshot, SubtreeReferenceSnapshot } from '@trace/snapshot'; +import type { FrameSnapshot, NodeNameAttributesChildNodesSnapshot, NodeSnapshot, RenderedFrameSnapshot, ResourceSnapshot, SubtreeReferenceSnapshot } from './trace'; import type { PageEntry } from './entries'; import type { LRUCache } from '../lruCache'; diff --git a/packages/isomorphic/trace/snapshotServer.ts b/packages/isomorphic/trace/snapshotServer.ts index 89a83ea29ffd8..2c60d7c19792f 100644 --- a/packages/isomorphic/trace/snapshotServer.ts +++ b/packages/isomorphic/trace/snapshotServer.ts @@ -17,8 +17,7 @@ import type { URLSearchParams } from 'url'; import type { SnapshotRenderer } from './snapshotRenderer'; import type { SnapshotStorage } from './snapshotStorage'; -import type { ResourceSnapshot } from '@trace/snapshot'; -import type { ActionPhase } from '@trace/trace'; +import type { ActionPhase, ResourceSnapshot } from './trace'; export class SnapshotServer { private _snapshotStorage: SnapshotStorage; diff --git a/packages/isomorphic/trace/snapshotStorage.ts b/packages/isomorphic/trace/snapshotStorage.ts index ee80afef64f49..d5d25dced8cd3 100644 --- a/packages/isomorphic/trace/snapshotStorage.ts +++ b/packages/isomorphic/trace/snapshotStorage.ts @@ -17,8 +17,7 @@ import { rewriteURLForCustomProtocol, SnapshotRenderer } from './snapshotRenderer'; import { LRUCache } from '../lruCache'; -import type { FrameSnapshot, ResourceSnapshot } from '@trace/snapshot'; -import type { ActionPhase } from '@trace/trace'; +import type { ActionPhase, FrameSnapshot, ResourceSnapshot } from './trace'; import type { PageEntry } from './entries'; diff --git a/packages/isomorphic/trace/trace.ts b/packages/isomorphic/trace/trace.ts new file mode 100644 index 0000000000000..781a0c2238c84 --- /dev/null +++ b/packages/isomorphic/trace/trace.ts @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type * from './versions/traceV9'; diff --git a/packages/isomorphic/trace/traceModel.ts b/packages/isomorphic/trace/traceModel.ts index 44503a467e500..851a13c056f88 100644 --- a/packages/isomorphic/trace/traceModel.ts +++ b/packages/isomorphic/trace/traceModel.ts @@ -17,9 +17,8 @@ import { getActionGroup, renderFullTitleForCall } from '../protocolFormatter'; import type { Language } from '../locatorGenerators'; -import type { ResourceSnapshot } from '@trace/snapshot'; -import type * as trace from '@trace/trace'; -import type { ActionTraceEvent } from '@trace/trace'; +import type * as trace from './trace'; +import type { ActionTraceEvent, ResourceSnapshot } from './trace'; import type { ActionEntry, ContextEntry, PageEntry } from './entries'; import type { ActionGroup } from '../protocolFormatter'; @@ -369,7 +368,11 @@ function adjustMonotonicTime(context: ContextEntry, monotonicTimeDelta: number) frame.timestamp += monotonicTimeDelta; } for (const video of context.videos || []) - video.timestampOrigin += monotonicTimeDelta; + video.timestamp += monotonicTimeDelta; + for (const screenshot of context.screenshots || []) + screenshot.timestamp += monotonicTimeDelta; + for (const ariaSnapshot of context.ariaSnapshots || []) + ariaSnapshot.timestamp += monotonicTimeDelta; for (const resource of context.resources) { if (resource._monotonicTime) resource._monotonicTime += monotonicTimeDelta; diff --git a/packages/isomorphic/trace/traceModernizer.ts b/packages/isomorphic/trace/traceModernizer.ts index 474569fc12e71..b165702e75c17 100644 --- a/packages/isomorphic/trace/traceModernizer.ts +++ b/packages/isomorphic/trace/traceModernizer.ts @@ -14,14 +14,13 @@ * limitations under the License. */ -import type * as trace from '@trace/trace'; +import type * as trace from './trace'; import type * as traceV3 from './versions/traceV3'; import type * as traceV4 from './versions/traceV4'; import type * as traceV5 from './versions/traceV5'; import type * as traceV6 from './versions/traceV6'; import type * as traceV7 from './versions/traceV7'; import type * as traceV8 from './versions/traceV8'; -import type { FrameSnapshot } from '@trace/snapshot'; import type { ActionEntry, ContextEntry, PageEntry } from './entries'; import type { SnapshotStorage } from './snapshotStorage'; @@ -32,9 +31,6 @@ export class TraceVersionError extends Error { } } -// 6 => 10/2023 ~1.40 -// 7 => 05/2024 ~1.45 -// 9 => 08/2026 ~1.63 const latestVersion: trace.VERSION = 9; // Ensures distinct api request refs across contexts of the same trace. @@ -230,48 +226,9 @@ export class TraceModernizer { let events = [event]; for (; version < latestVersion; ++version) events = (this as any)[`_modernize_${version}_to_${version + 1}`].call(this, events); - for (const e of events) - this._normalizeResourceReferences(e); return events; } - // Traces recorded before trace-relative paths referenced blobs by bare sha1-style names: - // `_sha1` in har entry content, `sha1` in snapshot resource overrides, screencast frames - // and attachments. - private _normalizeResourceReferences(event: any) { - if (event.type === 'resource-snapshot') { - const { request, response } = event.snapshot; - if (request?.postData?._sha1) { - request.postData._file = 'resources/' + request.postData._sha1; - delete request.postData._sha1; - } - if (response?.content?._sha1) { - response.content._file = 'resources/' + response.content._sha1; - delete response.content._sha1; - } - } - if (event.type === 'frame-snapshot') { - for (const override of event.snapshot.resourceOverrides || []) { - if (override.sha1) { - override.file = 'resources/' + override.sha1; - delete override.sha1; - } - } - } - if (event.type === 'screencast-frame' && event.sha1) { - event.file = 'resources/' + event.sha1; - delete event.sha1; - } - if (event.type === 'after' || event.type === 'action') { - for (const attachment of event.attachments || []) { - if (attachment.sha1) { - attachment.file = 'resources/' + attachment.sha1; - delete attachment.sha1; - } - } - } - } - _modernize_0_to_1(events: any[]): any[] { for (const event of events) { if (event.type !== 'action') @@ -522,19 +479,50 @@ export class TraceModernizer { delete action.inputSnapshot; delete action.afterSnapshot; } - if (event.type === 'frame-snapshot' && event.snapshot.snapshotName) - (event.snapshot as FrameSnapshot).phase = this._snapshotPhases.get(event.snapshot.snapshotName); - if (event.type !== 'resource-snapshot') - continue; - const snapshot = event.snapshot; - // Older traces marked api requests with a boolean instead of referencing - // their api request context. - if ((snapshot as any)._apiRequest) { - if (!this._apiRequestRef) - this._apiRequestRef = 'api-request-context@' + (++lastApiRequestRefOrdinal); - snapshot._apiRequestRef = this._apiRequestRef; - delete (snapshot as any)._apiRequest; + // Blobs used to be referenced by a bare sha1-style name, now they use a trace-relative path. + if (event.type === 'after' || event.type === 'action') { + for (const attachment of event.attachments || []) { + if (attachment.sha1) { + (attachment as trace.AfterActionTraceEventAttachment).file = 'resources/' + attachment.sha1; + delete attachment.sha1; + } + } + } + if (event.type === 'screencast-frame' && event.sha1) { + (event as any as trace.ScreencastFrameTraceEvent).file = 'resources/' + event.sha1; + delete (event as any).sha1; + } + + if (event.type === 'frame-snapshot') { + if (event.snapshot.snapshotName) + (event.snapshot as trace.FrameSnapshot).phase = this._snapshotPhases.get(event.snapshot.snapshotName); + for (const override of event.snapshot.resourceOverrides || []) { + if (override.sha1) { + (override as trace.ResourceOverride).file = 'resources/' + override.sha1; + delete override.sha1; + } + } + } + + if (event.type === 'resource-snapshot') { + const postData = event.snapshot.request?.postData; + if (postData?._sha1) { + postData._file = 'resources/' + postData._sha1; + delete postData._sha1; + } + const content = event.snapshot.response?.content; + if (content?._sha1) { + content._file = 'resources/' + content._sha1; + delete content._sha1; + } + // Older hars marked api requests with a boolean instead of referencing their api request context. + if (event.snapshot._apiRequest) { + if (!this._apiRequestRef) + this._apiRequestRef = 'api-request-context@' + (++lastApiRequestRefOrdinal); + (event as trace.ResourceSnapshotTraceEvent).snapshot._apiRequestRef = this._apiRequestRef; + delete event.snapshot._apiRequest; + } } } return events as trace.TraceEvent[]; diff --git a/packages/isomorphic/trace/traceUtils.ts b/packages/isomorphic/trace/traceUtils.ts index d9a2c1b8ce4c3..ab138b4a515ae 100644 --- a/packages/isomorphic/trace/traceUtils.ts +++ b/packages/isomorphic/trace/traceUtils.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { StackFrame } from '@trace/trace'; +import type { StackFrame } from './trace'; import type { ClientSideCallMetadata } from '@protocol/structs'; export type SerializedStackFrame = [number, number, number, string]; diff --git a/packages/trace/src/har.ts b/packages/isomorphic/trace/versions/har.ts similarity index 100% rename from packages/trace/src/har.ts rename to packages/isomorphic/trace/versions/har.ts diff --git a/packages/isomorphic/trace/versions/traceV3.ts b/packages/isomorphic/trace/versions/traceV3.ts index a9cb7d77046d3..2e44defa1afb4 100644 --- a/packages/isomorphic/trace/versions/traceV3.ts +++ b/packages/isomorphic/trace/versions/traceV3.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Entry as ResourceSnapshot } from '@trace/har'; +import type { Entry as ResourceSnapshot } from './har'; type SerializedValue = { n?: number, diff --git a/packages/isomorphic/trace/versions/traceV4.ts b/packages/isomorphic/trace/versions/traceV4.ts index 722604f0ad434..2c41648b60419 100644 --- a/packages/isomorphic/trace/versions/traceV4.ts +++ b/packages/isomorphic/trace/versions/traceV4.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Entry as ResourceSnapshot } from '@trace/har'; +import type { Entry as ResourceSnapshot } from './har'; type Language = 'javascript' | 'python' | 'java' | 'csharp' | 'jsonl'; type Point = { x: number, y: number }; diff --git a/packages/isomorphic/trace/versions/traceV5.ts b/packages/isomorphic/trace/versions/traceV5.ts index 54d54459cec2d..7ea00c5f13cdf 100644 --- a/packages/isomorphic/trace/versions/traceV5.ts +++ b/packages/isomorphic/trace/versions/traceV5.ts @@ -15,7 +15,7 @@ */ -import type { Entry as ResourceSnapshot } from '@trace/har'; +import type { Entry as ResourceSnapshot } from './har'; type Language = 'javascript' | 'python' | 'java' | 'csharp' | 'jsonl'; type Point = { x: number, y: number }; diff --git a/packages/isomorphic/trace/versions/traceV6.ts b/packages/isomorphic/trace/versions/traceV6.ts index 1b069a20b2681..b7e25bd572e91 100644 --- a/packages/isomorphic/trace/versions/traceV6.ts +++ b/packages/isomorphic/trace/versions/traceV6.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Entry as ResourceSnapshot } from '@trace/har'; +import type { Entry as ResourceSnapshot } from './har'; type Language = 'javascript' | 'python' | 'java' | 'csharp' | 'jsonl'; type Point = { x: number, y: number }; diff --git a/packages/isomorphic/trace/versions/traceV7.ts b/packages/isomorphic/trace/versions/traceV7.ts index 2388321417170..3a583422513ef 100644 --- a/packages/isomorphic/trace/versions/traceV7.ts +++ b/packages/isomorphic/trace/versions/traceV7.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { Entry as ResourceSnapshot } from '@trace/har'; +import type { Entry as ResourceSnapshot } from './har'; type Language = 'javascript' | 'python' | 'java' | 'csharp' | 'jsonl'; type Point = { x: number, y: number }; diff --git a/packages/isomorphic/trace/versions/traceV8.ts b/packages/isomorphic/trace/versions/traceV8.ts index 233a68b5d03b2..2ed20dfa7758c 100644 --- a/packages/isomorphic/trace/versions/traceV8.ts +++ b/packages/isomorphic/trace/versions/traceV8.ts @@ -14,7 +14,148 @@ * limitations under the License. */ -import type { Entry as ResourceSnapshot } from '@trace/har'; +// see http://www.softwareishard.com/blog/har-12-spec/ +type ResourceSnapshot = { + pageref?: string; + startedDateTime: string; + time: number; + request: Request; + response: Response; + cache: Cache; + timings: Timings; + serverIPAddress?: string; + connection?: string; + _frameref?: string; + _monotonicTime?: number; + _serverPort?: number; + _securityDetails?: SecurityDetails; + _wasAborted?: boolean; + _wasFulfilled?: boolean; + _wasContinued?: boolean; + _apiRequest?: boolean; + _resourceType?: string; + _webSocketMessages?: WebSocketMessage[]; +}; + +type WebSocketMessage = { + type: 'send' | 'receive'; + time: number; + opcode: number; + data: string; +}; + +type Request = { + method: string; + url: string; + httpVersion: string; + cookies: Cookie[]; + headers: Header[]; + queryString: QueryParameter[]; + postData?: PostData; + headersSize: number; + bodySize: number; + comment?: string; +}; + +type Response = { + status: number; + statusText: string; + httpVersion: string; + cookies: Cookie[]; + headers: Header[]; + content: Content; + redirectURL: string; + headersSize: number; + bodySize: number; + comment?: string; + _transferSize?: number; + _failureText?: string +}; + +type Cookie = { + name: string; + value: string; + path?: string; + domain?: string; + expires?: string; + httpOnly?: boolean; + secure?: boolean; + sameSite?: string; + comment?: string; +}; + +type Header = { + name: string; + value: string; + comment?: string; +}; + +type QueryParameter = { + name: string; + value: string; + comment?: string; +}; + +type PostData = { + mimeType: string; + params: Param[]; + text: string; + comment?: string; + _sha1?: string; + _file?: string; +}; + +type Param = { + name: string; + value?: string; + fileName?: string; + contentType?: string; + comment?: string; +}; + +type Content = { + size: number; + compression?: number; + mimeType: string; + text?: string; + encoding?: string; + comment?: string; + _sha1?: string; + _file?: string; +}; + +type Cache = { + beforeRequest?: CacheState | null; + afterRequest?: CacheState | null; + comment?: string; +}; + +type CacheState = { + expires?: string; + lastAccess: string; + eTag: string; + hitCount: number; + comment?: string; +}; + +type Timings = { + blocked?: number; + dns?: number; + connect?: number; + send: number; + wait: number; + receive: number; + ssl?: number; + comment?: string; +}; + +type SecurityDetails = { + protocol?: string; + subjectName?: string; + issuer?: string; + validFrom?: number; + validTo?: number; +}; type Language = 'javascript' | 'python' | 'java' | 'csharp' | 'jsonl'; type Point = { x: number, y: number }; diff --git a/packages/trace/src/trace.ts b/packages/isomorphic/trace/versions/traceV9.ts similarity index 75% rename from packages/trace/src/trace.ts rename to packages/isomorphic/trace/versions/traceV9.ts index d029a4a6a7e53..58db207ef1a00 100644 --- a/packages/trace/src/trace.ts +++ b/packages/isomorphic/trace/versions/traceV9.ts @@ -14,9 +14,9 @@ * limitations under the License. */ -import type { FrameSnapshot, ResourceSnapshot } from './snapshot'; -import type { Language } from '@isomorphic/locatorGenerators'; -import type { Point, Rect } from '@isomorphic/types'; +import type { Entry as HAREntry } from './har'; +import type { Language } from '../../locatorGenerators'; +import type { Point, Rect } from '../../types'; export type Size = { width: number, height: number }; @@ -68,6 +68,10 @@ export type SerializedError = { }; // Make sure you add _modernize_N_to_N1(event: any) to traceModernizer.ts. +// 6 => released in ~1.40 +// 7 => released in ~1.45 +// 8 => released in 1.53 +// 9 => released in 1.63 export type VERSION = 9; export type BrowserContextEventOptions = { @@ -108,10 +112,11 @@ export type ScreencastFrameTraceEvent = { export type VideoTraceEvent = { type: 'video', + pageId: string, file: string, width: number, height: number, - timestampOrigin: number, + timestamp: number, }; export type ActionPhase = 'before' | 'action' | 'after'; @@ -120,6 +125,8 @@ export type ScreenshotTraceEvent = { type: 'screenshot', callId: string, phase: ActionPhase, + pageId: string, + timestamp: number, file: string, }; @@ -127,6 +134,8 @@ export type AriaSnapshotTraceEvent = { type: 'aria-snapshot', callId: string, phase: ActionPhase, + pageId: string, + timestamp: number, file: string, }; @@ -206,6 +215,51 @@ export type ConsoleMessageTraceEvent = { }, }; +export type ResourceSnapshot = HAREntry; + +// Text node. +export type TextNodeSnapshot = string; +// Subtree reference, "x snapshots ago, node #y". Could point to a text node. +// Only nodes that are not references are counted, starting from zero, using post-order traversal. +export type SubtreeReferenceSnapshot = [ [number, number] ]; +// Node name, and optional attributes and child nodes. +export type NodeNameAttributesChildNodesSnapshot = [ string ] | [ string, Record, ...NodeSnapshot[] ]; + +export type NodeSnapshot = + TextNodeSnapshot | + SubtreeReferenceSnapshot | + NodeNameAttributesChildNodesSnapshot; + +export type ResourceOverride = { + url: string, + file?: string, + ref?: number +}; + +export type FrameSnapshot = { + phase?: ActionPhase, + snapshotName?: string, // Legacy, only present in traces recorded before phase was introduced. + callId: string, + pageId: string, + frameId: string, + frameUrl: string, + timestamp: number, + wallTime?: number, + collectionTime: number, + doctype?: string, + html: NodeSnapshot, + resourceOverrides: ResourceOverride[], + viewport: { width: number, height: number }, + isMainFrame: boolean, +}; + +export type RenderedFrameSnapshot = { + html: string; + pageId: string; + frameId: string; + index: number; +}; + export type ResourceSnapshotTraceEvent = { type: 'resource-snapshot', snapshot: ResourceSnapshot, diff --git a/packages/playwright-core/src/server/fetch.ts b/packages/playwright-core/src/server/fetch.ts index 2c086be4df794..012c71d47311c 100644 --- a/packages/playwright-core/src/server/fetch.ts +++ b/packages/playwright-core/src/server/fetch.ts @@ -45,7 +45,7 @@ import type { HeadersArray, ProxySettings } from './types'; import type { HttpCredentials } from '@protocol/structs'; import type { RegisteredListener } from '@utils/eventsHelper'; import type * as channels from './channels'; -import type * as har from '@trace/har'; +import type * as har from '@isomorphic/trace/versions/har'; import type { LookupAddress } from 'dns'; import type { Readable, TransformCallback } from 'stream'; diff --git a/packages/playwright-core/src/server/har/harRecorder.ts b/packages/playwright-core/src/server/har/harRecorder.ts index b8b8c80774fc4..40fadf7c6b335 100644 --- a/packages/playwright-core/src/server/har/harRecorder.ts +++ b/packages/playwright-core/src/server/har/harRecorder.ts @@ -26,7 +26,7 @@ import type { HarTracerDelegate } from './harTracer'; import type { Page } from '../page'; import type { NameValue } from '@isomorphic/types'; import type * as channels from '../channels'; -import type * as har from '@trace/har'; +import type * as har from '@isomorphic/trace/versions/har'; export class HarRecorder implements HarTracerDelegate { private _context: BrowserContext | APIRequestContext; diff --git a/packages/playwright-core/src/server/har/harTracer.ts b/packages/playwright-core/src/server/har/harTracer.ts index 930746ea08d03..923ab77d2c5e3 100644 --- a/packages/playwright-core/src/server/har/harTracer.ts +++ b/packages/playwright-core/src/server/har/harTracer.ts @@ -37,7 +37,7 @@ import type { RegisteredListener } from '@utils/eventsHelper'; import type { APIRequestEvent, APIRequestFinishedEvent } from '../fetch'; import type { Worker } from '../page'; import type { HeadersArray, LifecycleEvent } from '../types'; -import type * as har from '@trace/har'; +import type * as har from '@isomorphic/trace/versions/har'; const FALLBACK_HTTP_VERSION = 'HTTP/1.1'; diff --git a/packages/playwright-core/src/server/harBackend.ts b/packages/playwright-core/src/server/harBackend.ts index bff11879e112b..1b1a647cf4efa 100644 --- a/packages/playwright-core/src/server/harBackend.ts +++ b/packages/playwright-core/src/server/harBackend.ts @@ -22,7 +22,7 @@ import { isPathInside } from '@utils/fileUtils'; import { ZipFile } from '@utils/zipFile'; import type { HeadersArray } from '@isomorphic/types'; -import type * as har from '@trace/har'; +import type * as har from '@isomorphic/trace/versions/har'; const redirectStatus = [301, 302, 303, 307, 308]; diff --git a/packages/playwright-core/src/server/localUtils.ts b/packages/playwright-core/src/server/localUtils.ts index ba32e9ed38d03..b564feffc889c 100644 --- a/packages/playwright-core/src/server/localUtils.ts +++ b/packages/playwright-core/src/server/localUtils.ts @@ -28,7 +28,7 @@ import { ZipFile } from '@utils/zipFile'; import { removeFolders, resolveWithinRoot } from '@utils/fileUtils'; import { HarBackend } from './harBackend'; import type * as channels from './channels'; -import type * as har from '@trace/har'; +import type * as har from '@isomorphic/trace/versions/har'; import type EventEmitter from 'events'; import type { Progress } from './progress'; diff --git a/packages/playwright-core/src/server/trace/recorder/snapshotter.ts b/packages/playwright-core/src/server/trace/recorder/snapshotter.ts index 2601ecb05ac22..70bb85bb91e39 100644 --- a/packages/playwright-core/src/server/trace/recorder/snapshotter.ts +++ b/packages/playwright-core/src/server/trace/recorder/snapshotter.ts @@ -28,8 +28,7 @@ import type { SnapshotData } from './snapshotterInjected'; import type { RegisteredListener } from '@utils/eventsHelper'; import type { Frame } from '../../frames'; import type { InitScript } from '../../page'; -import type { FrameSnapshot } from '@trace/snapshot'; -import type { ActionPhase } from '@trace/trace'; +import type { ActionPhase, FrameSnapshot } from '@isomorphic/trace/trace'; import type { Progress } from '../../progress'; export type SnapshotterBlob = { diff --git a/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts b/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts index dc4927cc56267..a94775ef9a1e4 100644 --- a/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts +++ b/packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { NodeSnapshot } from '@trace/snapshot'; +import type { NodeSnapshot } from '@isomorphic/trace/trace'; export type SnapshotData = { doctype?: string, diff --git a/packages/playwright-core/src/server/trace/recorder/tracing.ts b/packages/playwright-core/src/server/trace/recorder/tracing.ts index 7bb1ff24d772a..b1dbca080ecb6 100644 --- a/packages/playwright-core/src/server/trace/recorder/tracing.ts +++ b/packages/playwright-core/src/server/trace/recorder/tracing.ts @@ -49,9 +49,8 @@ import type { HarTracerDelegate } from '../../har/harTracer'; import type { CallMetadata, InstrumentationListener } from '../../instrumentation'; import type { PageError } from '../../page'; import type { RecordHarOptions, StackFrame, TracingTracingStopChunkParams } from '../../channels'; -import type * as har from '@trace/har'; -import type { FrameSnapshot } from '@trace/snapshot'; -import type * as trace from '@trace/trace'; +import type * as har from '@isomorphic/trace/versions/har'; +import type * as trace from '@isomorphic/trace/trace'; import type { Progress } from '../../progress'; import type * as types from '../../types'; import type { Screencast, ScreencastClient } from '../../screencast'; @@ -512,7 +511,7 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps const file = `screenshots/${progress.metadata.id}-${phase}.png`; this._state.chunkFiles.add(file); this._appendResource(file, buffer); - this._appendTraceEvent({ type: 'screenshot', callId: progress.metadata.id, phase, file }); + this._appendTraceEvent({ type: 'screenshot', callId: progress.metadata.id, phase, pageId: page.guid, timestamp: monotonicTime(), file }); } private async _captureAriaSnapshot(progress: Progress, page: Page, phase: trace.ActionPhase): Promise { @@ -523,7 +522,7 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps const file = `aria/${progress.metadata.id}-${phase}.json`; this._state.chunkFiles.add(file); this._appendResource(file, buffer); - this._appendTraceEvent({ type: 'aria-snapshot', callId: progress.metadata.id, phase, file }); + this._appendTraceEvent({ type: 'aria-snapshot', callId: progress.metadata.id, phase, pageId: page.guid, timestamp: monotonicTime(), file }); } onBeforeCall(progress: Progress, sdkObject: SdkObject, parentId?: string) { @@ -623,7 +622,7 @@ export class Tracing extends SdkObject implements InstrumentationListener, Snaps return file; } - onFrameSnapshot(snapshot: FrameSnapshot): void { + onFrameSnapshot(snapshot: trace.FrameSnapshot): void { this._appendTraceEvent({ type: 'frame-snapshot', snapshot }); } diff --git a/packages/playwright-core/src/tools/trace/traceSnapshot.ts b/packages/playwright-core/src/tools/trace/traceSnapshot.ts index cf219379cbee6..24c7f848b5b73 100644 --- a/packages/playwright-core/src/tools/trace/traceSnapshot.ts +++ b/packages/playwright-core/src/tools/trace/traceSnapshot.ts @@ -29,7 +29,7 @@ import { commands } from '../cli-daemon/commands'; import { kActionPhases, loadTrace } from './traceUtils'; import type { SnapshotStorage } from '@isomorphic/trace/snapshotStorage'; -import type { ActionPhase } from '@trace/trace'; +import type { ActionPhase } from '@isomorphic/trace/trace'; export async function traceSnapshot(actionId: string, options: { phase?: string, serve?: boolean, browserArgs?: string[] }): Promise { const trace = await loadTrace(); diff --git a/packages/playwright-core/src/tools/trace/traceUtils.ts b/packages/playwright-core/src/tools/trace/traceUtils.ts index 09ad49ec144a1..10c5ec30c0bbb 100644 --- a/packages/playwright-core/src/tools/trace/traceUtils.ts +++ b/packages/playwright-core/src/tools/trace/traceUtils.ts @@ -24,7 +24,7 @@ import { resolveWithinRoot } from '@utils/fileUtils'; import { DirTraceLoaderBackend, extractTrace } from './traceParser'; import type { ActionEntry } from '@isomorphic/trace/entries'; -import type { ActionPhase } from '@trace/trace'; +import type { ActionPhase } from '@isomorphic/trace/trace'; const traceDir = path.join('.playwright-cli', 'trace'); const cliOutputDir = '.playwright-cli'; diff --git a/packages/playwright/src/worker/testTracing.ts b/packages/playwright/src/worker/testTracing.ts index f25923e64cdce..0583e936b2eee 100644 --- a/packages/playwright/src/worker/testTracing.ts +++ b/packages/playwright/src/worker/testTracing.ts @@ -29,7 +29,7 @@ import { filteredStackTrace } from '@utils/stackTrace'; import type { TestStepCategory, TestInfoImpl } from './testInfo'; import type { PlaywrightWorkerOptions, TestInfo, TestInfoError, TraceMode } from '../../types/test'; import type { StackFrame } from '@utils/stackTrace'; -import type * as trace from '@trace/trace'; +import type * as trace from '@isomorphic/trace/trace'; import type EventEmitter from 'events'; export type Attachment = TestInfo['attachments'][0]; diff --git a/packages/trace-viewer/src/third_party/devtools.ts b/packages/trace-viewer/src/third_party/devtools.ts index f355a327e67e4..e477b27493008 100644 --- a/packages/trace-viewer/src/third_party/devtools.ts +++ b/packages/trace-viewer/src/third_party/devtools.ts @@ -58,7 +58,7 @@ */ import type { TraceModel } from '@isomorphic/trace/traceModel'; -import type { Entry } from '@trace/har'; +import type { Entry } from '@isomorphic/trace/versions/har'; // The following function is derived from Chromium's source code // https://github.com/ChromeDevTools/devtools-frontend/blob/5d4c12362e84535371d8b966b0c7e421c236b720/front_end/panels/network/NetworkLogView.ts#L2441 diff --git a/packages/trace-viewer/src/ui/actionList.tsx b/packages/trace-viewer/src/ui/actionList.tsx index 17ed0cb07ee37..e5a642916cf5e 100644 --- a/packages/trace-viewer/src/ui/actionList.tsx +++ b/packages/trace-viewer/src/ui/actionList.tsx @@ -14,7 +14,7 @@ limitations under the License. */ -import type { ActionTraceEvent } from '@trace/trace'; +import type { ActionTraceEvent } from '@isomorphic/trace/trace'; import { clsx } from '@web/uiUtils'; import { msToString } from '@isomorphic/formatUtils'; import * as React from 'react'; diff --git a/packages/trace-viewer/src/ui/ariaModeView.tsx b/packages/trace-viewer/src/ui/ariaModeView.tsx index 6541b32bf560e..da0caec2f2830 100644 --- a/packages/trace-viewer/src/ui/ariaModeView.tsx +++ b/packages/trace-viewer/src/ui/ariaModeView.tsx @@ -21,7 +21,7 @@ import { renderAriaSnapshotAsYaml } from '@isomorphic/ariaSnapshotRenderer'; import { clsx, useMeasure } from '@web/uiUtils'; import { PlaceholderPanel } from './placeholderPanel'; -import type { ActionPhase, ActionTraceEvent, ScreenshotTraceEvent } from '@trace/trace'; +import type { ActionPhase, ActionTraceEvent, ScreenshotTraceEvent } from '@isomorphic/trace/trace'; import type { AriaNodeJSON, AriaSnapshotJSON } from '@isomorphic/ariaSnapshot'; import type { TraceModel } from '@isomorphic/trace/traceModel'; diff --git a/packages/trace-viewer/src/ui/callTab.tsx b/packages/trace-viewer/src/ui/callTab.tsx index 1e49091ac1a87..cab85c5142079 100644 --- a/packages/trace-viewer/src/ui/callTab.tsx +++ b/packages/trace-viewer/src/ui/callTab.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { ActionTraceEvent, SerializedValue } from '@trace/trace'; +import type { ActionTraceEvent, SerializedValue } from '@isomorphic/trace/trace'; import { clsx } from '@web/uiUtils'; import { msToString } from '@isomorphic/formatUtils'; import * as React from 'react'; diff --git a/packages/trace-viewer/src/ui/codegen.ts b/packages/trace-viewer/src/ui/codegen.ts index 2d77177a0a863..2936033c29f86 100644 --- a/packages/trace-viewer/src/ui/codegen.ts +++ b/packages/trace-viewer/src/ui/codegen.ts @@ -15,7 +15,7 @@ */ import type { Language } from '@isomorphic/locatorGenerators'; -import type * as har from '@trace/har'; +import type * as har from '@isomorphic/trace/versions/har'; interface APIRequestCodegen { generatePlaywrightRequestCall(request: har.Request, body: string | undefined): string; diff --git a/packages/trace-viewer/src/ui/consoleTab.tsx b/packages/trace-viewer/src/ui/consoleTab.tsx index 1c0a2bfabda2e..fae0b2078919f 100644 --- a/packages/trace-viewer/src/ui/consoleTab.tsx +++ b/packages/trace-viewer/src/ui/consoleTab.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { SerializedError } from '@trace/trace'; +import type { SerializedError } from '@isomorphic/trace/trace'; import * as React from 'react'; import './consoleTab.css'; import type { TraceModel } from '@isomorphic/trace/traceModel'; diff --git a/packages/trace-viewer/src/ui/networkResourceDetails.tsx b/packages/trace-viewer/src/ui/networkResourceDetails.tsx index 392aa0a0ad3ac..eadfbe0d1e0c3 100644 --- a/packages/trace-viewer/src/ui/networkResourceDetails.tsx +++ b/packages/trace-viewer/src/ui/networkResourceDetails.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import type { ResourceSnapshot } from '@trace/snapshot'; +import type { ResourceSnapshot } from '@isomorphic/trace/trace'; import * as React from 'react'; import './networkResourceDetails.css'; import { TabbedPane } from '@web/components/tabbedPane'; @@ -27,7 +27,7 @@ import type { Language } from '@isomorphic/locatorGenerators'; import { isJsonMimeType, isXmlMimeType } from '@isomorphic/mimeType'; import { useAsyncMemo, useSetting } from '@web/uiUtils'; import { bytesToString, msToString } from '@isomorphic/formatUtils'; -import type { Entry, WebSocketMessage } from '@trace/har'; +import type { Entry, WebSocketMessage } from '@isomorphic/trace/versions/har'; import { useTraceModel } from './traceModelContext'; import { Expandable } from '@web/components/expandable'; import { ListView } from '@web/components/listView'; diff --git a/packages/trace-viewer/src/ui/snapshotTab.tsx b/packages/trace-viewer/src/ui/snapshotTab.tsx index 70492660c84ec..6cd00da5ebfdc 100644 --- a/packages/trace-viewer/src/ui/snapshotTab.tsx +++ b/packages/trace-viewer/src/ui/snapshotTab.tsx @@ -16,7 +16,7 @@ import './snapshotTab.css'; import * as React from 'react'; -import type { ActionPhase, ActionTraceEvent } from '@trace/trace'; +import type { ActionPhase, ActionTraceEvent } from '@isomorphic/trace/trace'; import { nextActionByStartTime, previousActionByEndTime } from '@isomorphic/trace/traceModel'; import type { TraceModel } from '@isomorphic/trace/traceModel'; import { Toolbar } from '@web/components/toolbar'; diff --git a/packages/trace-viewer/src/ui/sourceTab.tsx b/packages/trace-viewer/src/ui/sourceTab.tsx index 046c9763f6864..88eb2bcd2a5b1 100644 --- a/packages/trace-viewer/src/ui/sourceTab.tsx +++ b/packages/trace-viewer/src/ui/sourceTab.tsx @@ -22,7 +22,7 @@ import { StackTraceView } from './stackTrace'; import { CodeMirrorWrapper } from '@web/components/codeMirrorWrapper'; import type { SourceHighlight } from '@web/components/codeMirrorWrapper'; import type { SourceLocation, SourceModel } from '@isomorphic/trace/traceModel'; -import type { StackFrame } from '@trace/trace'; +import type { StackFrame } from '@isomorphic/trace/trace'; import { CopyToClipboard } from './copyToClipboard'; import { ToolbarButton } from '@web/components/toolbarButton'; import { Toolbar } from '@web/components/toolbar'; diff --git a/packages/trace-viewer/src/ui/stackTrace.tsx b/packages/trace-viewer/src/ui/stackTrace.tsx index f479a88a0855e..a167f14d63330 100644 --- a/packages/trace-viewer/src/ui/stackTrace.tsx +++ b/packages/trace-viewer/src/ui/stackTrace.tsx @@ -17,7 +17,7 @@ import * as React from 'react'; import './stackTrace.css'; import { ListView } from '@web/components/listView'; -import type { StackFrame } from '@trace/trace'; +import type { StackFrame } from '@isomorphic/trace/trace'; const StackFrameListView = ListView; diff --git a/packages/trace-viewer/src/ui/videoThumbnails.ts b/packages/trace-viewer/src/ui/videoThumbnails.ts index ebaac09bf6b20..168ae1cf654e2 100644 --- a/packages/trace-viewer/src/ui/videoThumbnails.ts +++ b/packages/trace-viewer/src/ui/videoThumbnails.ts @@ -15,7 +15,7 @@ */ import * as React from 'react'; -import type * as trace from '@trace/trace'; +import type * as trace from '@isomorphic/trace/trace'; export type VideoThumbnail = { timestamp: number; @@ -102,7 +102,7 @@ async function generateThumbnails(entry: CacheEntry, video: trace.VideoTraceEven if (!frame) continue; entry.thumbnails.push({ - timestamp: video.timestampOrigin + time * 1000, + timestamp: video.timestamp + time * 1000, url: URL.createObjectURL(frame), width, height, diff --git a/packages/trace-viewer/vite.config.ts b/packages/trace-viewer/vite.config.ts index fbb0a6883c5e4..ac30801db686d 100644 --- a/packages/trace-viewer/vite.config.ts +++ b/packages/trace-viewer/vite.config.ts @@ -37,7 +37,6 @@ export default defineConfig({ '@injected': path.resolve(__dirname, '../injected/src'), '@isomorphic': path.resolve(__dirname, '../isomorphic'), '@testIsomorphic': path.resolve(__dirname, '../playwright/src/isomorphic'), - '@trace': path.resolve(__dirname, '../trace/src'), '@web': path.resolve(__dirname, '../web/src'), }, }, diff --git a/packages/trace/src/DEPS.list b/packages/trace/src/DEPS.list deleted file mode 100644 index e43dcb5d9f30b..0000000000000 --- a/packages/trace/src/DEPS.list +++ /dev/null @@ -1 +0,0 @@ -[*] diff --git a/packages/trace/src/snapshot.ts b/packages/trace/src/snapshot.ts deleted file mode 100644 index 8f3b01f7e73ef..0000000000000 --- a/packages/trace/src/snapshot.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) Microsoft Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { Entry as HAREntry } from './har'; -import type { ActionPhase } from './trace'; - -export type ResourceSnapshot = HAREntry; - -// Text node. -export type TextNodeSnapshot = string; -// Subtree reference, "x snapshots ago, node #y". Could point to a text node. -// Only nodes that are not references are counted, starting from zero, using post-order traversal. -export type SubtreeReferenceSnapshot = [ [number, number] ]; -// Node name, and optional attributes and child nodes. -export type NodeNameAttributesChildNodesSnapshot = [ string ] | [ string, Record, ...NodeSnapshot[] ]; - -export type NodeSnapshot = - TextNodeSnapshot | - SubtreeReferenceSnapshot | - NodeNameAttributesChildNodesSnapshot; - -export type ResourceOverride = { - url: string, - file?: string, - ref?: number -}; - -export type FrameSnapshot = { - phase?: ActionPhase, - snapshotName?: string, // Legacy, only present in traces recorded before phase was introduced. - callId: string, - pageId: string, - frameId: string, - frameUrl: string, - timestamp: number, - wallTime?: number, - collectionTime: number, - doctype?: string, - html: NodeSnapshot, - resourceOverrides: ResourceOverride[], - viewport: { width: number, height: number }, - isMainFrame: boolean, -}; - -export type RenderedFrameSnapshot = { - html: string; - pageId: string; - frameId: string; - index: number; -}; diff --git a/tests/config/browserTest.ts b/tests/config/browserTest.ts index 651d14c602a11..e64803f81fcfd 100644 --- a/tests/config/browserTest.ts +++ b/tests/config/browserTest.ts @@ -24,7 +24,7 @@ import { isBidiChannel, parseHar } from '../config/utils'; import type { PageTestFixtures, PageWorkerFixtures } from '../page/pageTestApi'; import type { RemoteServerOptions, PlaywrightServer } from './remoteServer'; import type { BrowserContext, BrowserContextOptions, BrowserType, Page } from 'playwright-core'; -import type { Log } from '../../packages/trace/src/har'; +import type { Log } from '../../packages/isomorphic/trace/versions/har'; const { removeFolders, hostPlatform } = utils; diff --git a/tests/config/utils.ts b/tests/config/utils.ts index 751721cbfcff1..b28fc36365428 100644 --- a/tests/config/utils.ts +++ b/tests/config/utils.ts @@ -19,7 +19,7 @@ import { utils, iso } from '../../packages/playwright-core/lib/coreBundle'; import type { iso as isoType } from '../../packages/playwright-core/lib/coreBundle'; import type { Locator, Frame, Page } from 'playwright-core'; -import type { StackFrame, ActionTraceEvent, TraceEvent } from '@trace/trace'; +import type { StackFrame, ActionTraceEvent, TraceEvent } from '@isomorphic/trace/trace'; const { TraceLoader, TraceModel } = iso; type TraceModel = InstanceType; diff --git a/tests/library/har-websocket.spec.ts b/tests/library/har-websocket.spec.ts index eaedb134bb475..622d3b4b2eb7d 100644 --- a/tests/library/har-websocket.spec.ts +++ b/tests/library/har-websocket.spec.ts @@ -21,7 +21,7 @@ import fs from 'fs'; import net from 'net'; import type { BrowserContext, BrowserContextOptions } from 'playwright-core'; import type { AddressInfo } from 'net'; -import type { Entry, Log, WebSocketMessage } from '../../packages/trace/src/har'; +import type { Entry, Log, WebSocketMessage } from '../../packages/isomorphic/trace/versions/har'; async function pageWithHar(contextFactory: (options?: BrowserContextOptions) => Promise, testInfo: any, options: { outputPath?: string } & Partial> = {}) { const harPath = testInfo.outputPath(options.outputPath || 'test.har'); diff --git a/tests/library/har.spec.ts b/tests/library/har.spec.ts index 4857202ccdc5e..73d2e8bf52aa4 100644 --- a/tests/library/har.spec.ts +++ b/tests/library/har.spec.ts @@ -20,7 +20,7 @@ import fs from 'fs'; import path from 'path'; import type { BrowserContext, BrowserContextOptions } from 'playwright-core'; import type { AddressInfo } from 'net'; -import type { Log } from '../../packages/trace/src/har'; +import type { Log } from '../../packages/isomorphic/trace/versions/har'; import { parseHar } from '../config/utils'; import { TestServer } from '../config/testserver'; import { utils } from '../../packages/playwright-core/lib/coreBundle'; diff --git a/tests/library/snapshot-renderer.spec.ts b/tests/library/snapshot-renderer.spec.ts index f512a6933b57c..8c6c4823b9c3f 100644 --- a/tests/library/snapshot-renderer.spec.ts +++ b/tests/library/snapshot-renderer.spec.ts @@ -18,7 +18,7 @@ import { test, expect } from '@playwright/test'; import { SnapshotRenderer } from '../../packages/isomorphic/trace/snapshotRenderer'; import { LRUCache } from '../../packages/isomorphic/lruCache'; import { stripAnsiEscapes } from '../../packages/isomorphic/stringUtils'; -import type { FrameSnapshot } from '../../packages/trace/src/snapshot'; +import type { FrameSnapshot } from '../../packages/isomorphic/trace/trace'; function makeSnapshot(overrides: Partial = {}): FrameSnapshot { return { diff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.ts index f12de90308e4a..53ea505d735aa 100644 --- a/tests/library/tracing.spec.ts +++ b/tests/library/tracing.spec.ts @@ -19,7 +19,7 @@ import { PNG, jpegjs } from 'playwright-core/lib/utilsBundle'; import path from 'path'; import { browserTest, contextTest as test, expect } from '../config/browserTest'; import { parseTraceRaw } from '../config/utils'; -import type { StackFrame, ActionTraceEvent } from '../../packages/trace/src/trace'; +import type { StackFrame, ActionTraceEvent } from '../../packages/isomorphic/trace/trace'; import { artifactsFolderName } from '../../packages/playwright/src/isomorphic/folders'; import { rafraf } from '../page/pageTest'; diff --git a/tests/page/page-request-fulfill.spec.ts b/tests/page/page-request-fulfill.spec.ts index 7e5f0f9caf8c4..d1772c9c0f767 100644 --- a/tests/page/page-request-fulfill.spec.ts +++ b/tests/page/page-request-fulfill.spec.ts @@ -17,7 +17,7 @@ import { test as base, expect } from './pageTest'; import fs from 'fs'; -import type * as har from '../../packages/trace/src/har'; +import type * as har from '../../packages/isomorphic/trace/versions/har'; import type { Route } from 'playwright-core'; const it = base.extend<{ diff --git a/tests/tsconfig.json b/tests/tsconfig.json index b2e0e14ddd899..43d324cb50475 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -16,7 +16,6 @@ "@utils/*": ["packages/utils/*"], "@testIsomorphic/*": ["packages/playwright/src/isomorphic/*"], "@recorder/*": ["packages/recorder/src/*"], - "@trace/*": ["packages/trace/src/*"], "@web/*": ["packages/web/src/*"], }, "esModuleInterop": true, diff --git a/tsconfig.json b/tsconfig.json index 8401d4f79c081..0eaa08c705cc2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,6 @@ "@protocol/*": ["./packages/protocol/src/*"], "@recorder/*": ["./packages/recorder/src/*"], "@testIsomorphic/*": ["./packages/playwright/src/isomorphic/*"], - "@trace/*": ["./packages/trace/src/*"], "@web/*": ["./packages/web/src/*"], "playwright-core/lib/*": ["./packages/playwright-core/src/*"], "playwright/lib/*": ["./packages/playwright/src/*"], diff --git a/utils/check_deps.js b/utils/check_deps.js index aeac9fe6acdde..dda7ea3836785 100644 --- a/utils/check_deps.js +++ b/utils/check_deps.js @@ -42,7 +42,6 @@ async function checkDeps() { await innerCheckDeps(path.join(packagesDir, 'protocol')); await innerCheckDeps(path.join(packagesDir, 'recorder')); await innerCheckDeps(path.join(packagesDir, 'trace-viewer')); - await innerCheckDeps(path.join(packagesDir, 'trace')); await innerCheckDeps(path.join(packagesDir, 'web')); await innerCheckDeps(path.join(packagesDir, 'injected'));